home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1990 September: Essentials 4 / ADC Developer CD (1990-09) [Essentials 4]_iso / Developer Essentials 4.iso / d e v e l o p / develop 1 code / the Palette Manager / Sample.f / Sample.p < prev    next >
MacBinary  |  1989-09-20  |  17.9 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert ZX81 Sinclair BASIC (image/sinclairBASIC) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Applause Picture (image/applausePicture) ext Unsupported
1% dexvert bsdiff patch (other/bsdiffPatch) ext Unsupported
1% dexvert imgdiff patch (other/imgdiffPatch) ext Unsupported
1% dexvert MATLAB p-code (other/matlabPCode) ext Unsupported
1% dexvert WSUS Patch Storage File (other/wsusPatchStorageFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Wed Sep 20 17:18:13 1989, modified Wed Sep 20 17:18:13 1989, creator 'MPS ', type ASCII, 17664 bytes "Sample.p" , at 0x4580 435 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 53 61 6d 70 6c 65 | 2e 70 00 00 00 00 00 00 |..Sample|.p......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 3f 00 62 00 |.TEXTMPS| ...?.b.|
|00000050| 00 00 00 00 00 45 00 00 | 00 01 b3 a1 3d af 15 a1 |.....E..|....=...|
|00000060| 3d af 15 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |=.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 3b 2e 00 00 |........|....;...|
|00000080| 7b 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |{-------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |--------|-------.|
|000000d0| 23 0d 23 09 41 70 70 6c | 65 20 4d 61 63 69 6e 74 |#.#.Appl|e Macint|
|000000e0| 6f 73 68 20 44 65 76 65 | 6c 6f 70 65 72 20 54 65 |osh Deve|loper Te|
|000000f0| 63 68 6e 69 63 61 6c 20 | 53 75 70 70 6f 72 74 0d |chnical |Support.|
|00000100| 23 0d 23 09 4d 75 6c 74 | 69 46 69 6e 64 65 72 2d |#.#.Mult|iFinder-|
|00000110| 41 77 61 72 65 20 53 69 | 6d 70 6c 65 20 53 61 6d |Aware Si|mple Sam|
|00000120| 70 6c 65 20 41 70 70 6c | 69 63 61 74 69 6f 6e 0d |ple Appl|ication.|
|00000130| 23 0d 23 09 53 61 6d 70 | 6c 65 0d 23 0d 23 09 53 |#.#.Samp|le.#.#.S|
|00000140| 61 6d 70 6c 65 2e 70 09 | 2d 09 50 61 73 63 61 6c |ample.p.|-.Pascal|
|00000150| 20 53 6f 75 72 63 65 0d | 23 0d 23 09 43 6f 70 79 | Source.|#.#.Copy|
|00000160| 72 69 67 68 74 20 a9 20 | 31 39 38 39 20 41 70 70 |right . |1989 App|
|00000170| 6c 65 20 43 6f 6d 70 75 | 74 65 72 2c 20 49 6e 63 |le Compu|ter, Inc|
|00000180| 2e 0d 23 09 41 6c 6c 20 | 72 69 67 68 74 73 20 72 |..#.All |rights r|
|00000190| 65 73 65 72 76 65 64 2e | 0d 23 0d 23 09 56 65 72 |eserved.|.#.#.Ver|
|000001a0| 73 69 6f 6e 73 3a 09 0d | 23 09 09 09 09 31 2e 30 |sions:..|#....1.0|
|000001b0| 30 09 09 09 09 30 38 2f | 38 38 0d 23 09 09 09 09 |0....08/|88.#....|
|000001c0| 31 2e 30 31 09 09 09 09 | 31 31 2f 38 38 0d 23 09 |1.01....|11/88.#.|
|000001d0| 09 09 09 31 2e 30 32 09 | 09 09 09 30 34 2f 38 39 |...1.02.|...04/89|
|000001e0| 09 4d 50 57 20 33 2e 31 | 0d 23 0d 23 09 43 6f 6d |.MPW 3.1|.#.#.Com|
|000001f0| 70 6f 6e 65 6e 74 73 3a | 0d 23 09 09 09 09 53 61 |ponents:|.#....Sa|
|00000200| 6d 70 6c 65 2e 70 09 09 | 09 41 70 72 69 6c 20 31 |mple.p..|.April 1|
|00000210| 2c 20 31 39 38 39 0d 23 | 09 09 09 09 53 61 6d 70 |, 1989.#|....Samp|
|00000220| 6c 65 2e 63 09 09 09 41 | 70 72 69 6c 20 31 2c 20 |le.c...A|pril 1, |
|00000230| 31 39 38 39 0d 23 09 09 | 09 09 53 61 6d 70 6c 65 |1989.#..|..Sample|
|00000240| 2e 61 09 09 09 41 70 72 | 69 6c 20 31 2c 20 31 39 |.a...Apr|il 1, 19|
|00000250| 38 39 0d 23 09 09 09 09 | 53 61 6d 70 6c 65 2e 69 |89.#....|Sample.i|
|00000260| 6e 63 31 2e 61 09 09 41 | 70 72 69 6c 20 31 2c 20 |nc1.a..A|pril 1, |
|00000270| 31 39 38 39 0d 23 09 09 | 09 09 53 61 6d 70 6c 65 |1989.#..|..Sample|
|00000280| 4d 69 73 63 2e 61 09 09 | 41 70 72 69 6c 20 31 2c |Misc.a..|April 1,|
|00000290| 20 31 39 38 39 0d 23 09 | 09 09 09 53 61 6d 70 6c | 1989.#.|...Sampl|
|000002a0| 65 2e 72 09 09 09 41 70 | 72 69 6c 20 31 2c 20 31 |e.r...Ap|ril 1, 1|
|000002b0| 39 38 39 0d 23 09 09 09 | 09 53 61 6d 70 6c 65 2e |989.#...|.Sample.|
|000002c0| 68 09 09 09 41 70 72 69 | 6c 20 31 2c 20 31 39 38 |h...Apri|l 1, 198|
|000002d0| 39 0d 23 09 09 09 09 5b | 50 5d 53 61 6d 70 6c 65 |9.#....[|P]Sample|
|000002e0| 2e 6d 61 6b 65 09 09 41 | 70 72 69 6c 20 31 2c 20 |.make..A|pril 1, |
|000002f0| 31 39 38 39 0d 23 09 09 | 09 09 5b 43 5d 53 61 6d |1989.#..|..[C]Sam|
|00000300| 70 6c 65 2e 6d 61 6b 65 | 09 09 41 70 72 69 6c 20 |ple.make|..April |
|00000310| 31 2c 20 31 39 38 39 0d | 23 09 09 09 09 5b 41 5d |1, 1989.|#....[A]|
|00000320| 53 61 6d 70 6c 65 2e 6d | 61 6b 65 09 09 41 70 72 |Sample.m|ake..Apr|
|00000330| 69 6c 20 31 2c 20 31 39 | 38 39 0d 23 0d 23 09 53 |il 1, 19|89.#.#.S|
|00000340| 61 6d 70 6c 65 20 69 73 | 20 61 6e 20 65 78 61 6d |ample is| an exam|
|00000350| 70 6c 65 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |ple appl|ication |
|00000360| 74 68 61 74 20 64 65 6d | 6f 6e 73 74 72 61 74 65 |that dem|onstrate|
|00000370| 73 20 68 6f 77 20 74 6f | 0d 23 09 69 6e 69 74 69 |s how to|.#.initi|
|00000380| 61 6c 69 7a 65 20 74 68 | 65 20 63 6f 6d 6d 6f 6e |alize th|e common|
|00000390| 6c 79 20 75 73 65 64 20 | 74 6f 6f 6c 62 6f 78 20 |ly used |toolbox |
|000003a0| 6d 61 6e 61 67 65 72 73 | 2c 20 6f 70 65 72 61 74 |managers|, operat|
|000003b0| 65 20 0d 23 09 73 75 63 | 63 65 73 73 66 75 6c 6c |e .#.suc|cessfull|
|000003c0| 79 20 75 6e 64 65 72 20 | 4d 75 6c 74 69 46 69 6e |y under |MultiFin|
|000003d0| 64 65 72 2c 20 68 61 6e | 64 6c 65 20 64 65 73 6b |der, han|dle desk|
|000003e0| 20 61 63 63 65 73 73 6f | 72 69 65 73 2c 20 0d 23 | accesso|ries, .#|
|000003f0| 09 61 6e 64 20 63 72 65 | 61 74 65 2c 20 67 72 6f |.and cre|ate, gro|
|00000400| 77 2c 20 61 6e 64 20 7a | 6f 6f 6d 20 77 69 6e 64 |w, and z|oom wind|
|00000410| 6f 77 73 2e 0d 23 0d 23 | 09 49 74 20 64 6f 65 73 |ows..#.#|.It does|
|00000420| 20 6e 6f 74 20 62 79 20 | 61 6e 79 20 6d 65 61 6e | not by |any mean|
|00000430| 73 20 64 65 6d 6f 6e 73 | 74 72 61 74 65 20 61 6c |s demons|trate al|
|00000440| 6c 20 74 68 65 20 74 65 | 63 68 6e 69 71 75 65 73 |l the te|chniques|
|00000450| 20 0d 23 09 79 6f 75 20 | 6e 65 65 64 20 66 6f 72 | .#.you |need for|
|00000460| 20 61 20 6c 61 72 67 65 | 20 61 70 70 6c 69 63 61 | a large| applica|
|00000470| 74 69 6f 6e 2e 20 49 6e | 20 70 61 72 74 69 63 75 |tion. In| particu|
|00000480| 6c 61 72 2c 20 53 61 6d | 70 6c 65 20 0d 23 09 64 |lar, Sam|ple .#.d|
|00000490| 6f 65 73 20 6e 6f 74 20 | 63 6f 76 65 72 20 65 78 |oes not |cover ex|
|000004a0| 63 65 70 74 69 6f 6e 20 | 68 61 6e 64 6c 69 6e 67 |ception |handling|
|000004b0| 2c 20 6d 75 6c 74 69 70 | 6c 65 20 77 69 6e 64 6f |, multip|le windo|
|000004c0| 77 73 2f 64 6f 63 75 6d | 65 6e 74 73 2c 20 0d 23 |ws/docum|ents, .#|
|000004d0| 09 73 6f 70 68 69 73 74 | 69 63 61 74 65 64 20 6d |.sophist|icated m|
|000004e0| 65 6d 6f 72 79 20 6d 61 | 6e 61 67 65 6d 65 6e 74 |emory ma|nagement|
|000004f0| 2c 20 70 72 69 6e 74 69 | 6e 67 2c 20 6f 72 20 75 |, printi|ng, or u|
|00000500| 6e 64 6f 2e 20 41 6c 6c | 20 6f 66 20 0d 23 09 74 |ndo. All| of .#.t|
|00000510| 68 65 73 65 20 61 72 65 | 20 76 69 74 61 6c 20 70 |hese are| vital p|
|00000520| 61 72 74 73 20 6f 66 20 | 61 20 6e 6f 72 6d 61 6c |arts of |a normal|
|00000530| 20 66 75 6c 6c 2d 73 69 | 7a 65 64 20 61 70 70 6c | full-si|zed appl|
|00000540| 69 63 61 74 69 6f 6e 2e | 0d 23 0d 23 09 54 68 69 |ication.|.#.#.Thi|
|00000550| 73 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 69 73 |s applic|ation is|
|00000560| 20 61 6e 20 65 78 61 6d | 70 6c 65 20 6f 66 20 74 | an exam|ple of t|
|00000570| 68 65 20 66 6f 72 6d 20 | 6f 66 20 61 20 4d 61 63 |he form |of a Mac|
|00000580| 69 6e 74 6f 73 68 20 0d | 23 09 61 70 70 6c 69 63 |intosh .|#.applic|
|00000590| 61 74 69 6f 6e 3b 20 69 | 74 20 69 73 20 4e 4f 54 |ation; i|t is NOT|
|000005a0| 20 61 20 74 65 6d 70 6c | 61 74 65 2e 20 49 74 20 | a templ|ate. It |
|000005b0| 69 73 20 4e 4f 54 20 69 | 6e 74 65 6e 64 65 64 20 |is NOT i|ntended |
|000005c0| 74 6f 20 62 65 20 0d 23 | 09 75 73 65 64 20 61 73 |to be .#|.used as|
|000005d0| 20 61 20 66 6f 75 6e 64 | 61 74 69 6f 6e 20 66 6f | a found|ation fo|
|000005e0| 72 20 74 68 65 20 6e 65 | 78 74 20 77 6f 72 6c 64 |r the ne|xt world|
|000005f0| 2d 63 6c 61 73 73 2c 20 | 62 65 73 74 2d 73 65 6c |-class, |best-sel|
|00000600| 6c 69 6e 67 2c 20 0d 23 | 09 36 30 30 4b 20 61 70 |ling, .#|.600K ap|
|00000610| 70 6c 69 63 61 74 69 6f | 6e 2e 20 41 20 73 74 69 |plicatio|n. A sti|
|00000620| 63 6b 20 66 69 67 75 72 | 65 20 64 72 61 77 69 6e |ck figur|e drawin|
|00000630| 67 20 6f 66 20 74 68 65 | 20 68 75 6d 61 6e 20 62 |g of the| human b|
|00000640| 6f 64 79 20 6d 61 79 20 | 0d 23 09 62 65 20 61 20 |ody may |.#.be a |
|00000650| 67 6f 6f 64 20 65 78 61 | 6d 70 6c 65 20 6f 66 20 |good exa|mple of |
|00000660| 74 68 65 20 66 6f 72 6d | 20 66 6f 72 20 61 20 70 |the form| for a p|
|00000670| 61 69 6e 74 69 6e 67 2c | 20 62 75 74 20 74 68 61 |ainting,| but tha|
|00000680| 74 20 64 6f 65 73 20 6e | 6f 74 20 0d 23 09 6d 65 |t does n|ot .#.me|
|00000690| 61 6e 20 69 74 20 73 68 | 6f 75 6c 64 20 62 65 20 |an it sh|ould be |
|000006a0| 75 73 65 64 20 61 73 20 | 74 68 65 20 62 61 73 69 |used as |the basi|
|000006b0| 73 20 66 6f 72 20 74 68 | 65 20 6e 65 78 74 20 4d |s for th|e next M|
|000006c0| 6f 6e 61 20 4c 69 73 61 | 2e 0d 23 0d 23 09 57 65 |ona Lisa|..#.#.We|
|000006d0| 20 72 65 63 6f 6d 6d 65 | 6e 64 20 74 68 61 74 20 | recomme|nd that |
|000006e0| 79 6f 75 20 72 65 76 69 | 65 77 20 74 68 69 73 20 |you revi|ew this |
|000006f0| 70 72 6f 67 72 61 6d 20 | 6f 72 20 54 45 53 61 6d |program |or TESam|
|00000700| 70 6c 65 20 62 65 66 6f | 72 65 20 0d 23 09 62 65 |ple befo|re .#.be|
|00000710| 67 69 6e 6e 69 6e 67 20 | 61 20 6e 65 77 20 61 70 |ginning |a new ap|
|00000720| 70 6c 69 63 61 74 69 6f | 6e 2e 0d 23 0d 2d 2d 2d |plicatio|n..#.---|
|00000730| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000740| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000750| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000760| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000770| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 7d 0d 0d 0d 50 |--------|---}...P|
|00000780| 52 4f 47 52 41 4d 20 53 | 61 6d 70 6c 65 3b 0d 0d |ROGRAM S|ample;..|
|00000790| 0d 7b 53 65 67 6d 65 6e | 74 61 74 69 6f 6e 20 73 |.{Segmen|tation s|
|000007a0| 74 72 61 74 65 67 79 3a | 0d 0d 20 54 68 69 73 20 |trategy:|.. This |
|000007b0| 70 72 6f 67 72 61 6d 20 | 63 6f 6e 73 69 73 74 73 |program |consists|
|000007c0| 20 6f 66 20 74 68 72 65 | 65 20 73 65 67 6d 65 6e | of thre|e segmen|
|000007d0| 74 73 2e 20 4d 61 69 6e | 20 63 6f 6e 74 61 69 6e |ts. Main| contain|
|000007e0| 73 20 6d 6f 73 74 20 6f | 66 20 74 68 65 20 63 6f |s most o|f the co|
|000007f0| 64 65 2c 0d 20 69 6e 63 | 6c 75 64 69 6e 67 20 74 |de,. inc|luding t|
|00000800| 68 65 20 4d 50 57 20 6c | 69 62 72 61 72 69 65 73 |he MPW l|ibraries|
|00000810| 2c 20 61 6e 64 20 74 68 | 65 20 6d 61 69 6e 20 70 |, and th|e main p|
|00000820| 72 6f 67 72 61 6d 2e 20 | 49 6e 69 74 69 61 6c 69 |rogram. |Initiali|
|00000830| 7a 65 20 63 6f 6e 74 61 | 69 6e 73 0d 20 63 6f 64 |ze conta|ins. cod|
|00000840| 65 20 74 68 61 74 20 69 | 73 20 6f 6e 6c 79 20 75 |e that i|s only u|
|00000850| 73 65 64 20 6f 6e 63 65 | 2c 20 64 75 72 69 6e 67 |sed once|, during|
|00000860| 20 73 74 61 72 74 75 70 | 2c 20 61 6e 64 20 63 61 | startup|, and ca|
|00000870| 6e 20 62 65 20 75 6e 6c | 6f 61 64 65 64 20 61 66 |n be unl|oaded af|
|00000880| 74 65 72 20 74 68 65 0d | 20 70 72 6f 67 72 61 6d |ter the.| program|
|00000890| 20 73 74 61 72 74 73 2e | 20 25 41 35 49 6e 69 74 | starts.| %A5Init|
|000008a0| 20 69 73 20 61 75 74 6f | 6d 61 74 69 63 61 6c 6c | is auto|maticall|
|000008b0| 79 20 63 72 65 61 74 65 | 64 20 62 79 20 74 68 65 |y create|d by the|
|000008c0| 20 4c 69 6e 6b 65 72 20 | 74 6f 20 69 6e 69 74 69 | Linker |to initi|
|000008d0| 61 6c 69 7a 65 0d 20 67 | 6c 6f 62 61 6c 73 20 66 |alize. g|lobals f|
|000008e0| 6f 72 20 74 68 65 20 4d | 50 57 20 6c 69 62 72 61 |or the M|PW libra|
|000008f0| 72 69 65 73 20 61 6e 64 | 20 69 73 20 75 6e 6c 6f |ries and| is unlo|
|00000900| 61 64 65 64 20 72 69 67 | 68 74 20 61 77 61 79 2e |aded rig|ht away.|
|00000910| 7d 0d 0d 0d 7b 53 65 74 | 50 6f 72 74 20 73 74 72 |}...{Set|Port str|
|00000920| 61 74 65 67 79 3a 0d 0d | 20 54 6f 6f 6c 62 6f 78 |ategy:..| Toolbox|
|00000930| 20 72 6f 75 74 69 6e 65 | 73 20 64 6f 20 6e 6f 74 | routine|s do not|
|00000940| 20 63 68 61 6e 67 65 20 | 74 68 65 20 63 75 72 72 | change |the curr|
|00000950| 65 6e 74 20 70 6f 72 74 | 2e 20 49 6e 20 73 70 69 |ent port|. In spi|
|00000960| 74 65 20 6f 66 20 74 68 | 69 73 2c 20 77 65 20 75 |te of th|is, we u|
|00000970| 73 65 20 0d 20 61 20 73 | 74 72 61 74 65 67 79 20 |se . a s|trategy |
|00000980| 6f 66 20 63 61 6c 6c 69 | 6e 67 20 53 65 74 50 6f |of calli|ng SetPo|
|00000990| 72 74 20 77 68 65 6e 65 | 76 65 72 20 77 65 20 77 |rt whene|ver we w|
|000009a0| 61 6e 74 20 74 6f 20 64 | 72 61 77 20 6f 72 20 6d |ant to d|raw or m|
|000009b0| 61 6b 65 20 63 61 6c 6c | 73 20 77 68 69 63 68 20 |ake call|s which |
|000009c0| 64 65 70 65 6e 64 0d 20 | 6f 6e 20 74 68 65 20 63 |depend. |on the c|
|000009d0| 75 72 72 65 6e 74 20 70 | 6f 72 74 2e 20 54 68 69 |urrent p|ort. Thi|
|000009e0| 73 20 6d 61 6b 65 73 20 | 75 73 20 6c 65 73 73 20 |s makes |us less |
|000009f0| 76 75 6c 6e 65 72 61 62 | 6c 65 20 74 6f 20 62 75 |vulnerab|le to bu|
|00000a00| 67 73 20 69 6e 20 6f 74 | 68 65 72 20 73 6f 66 74 |gs in ot|her soft|
|00000a10| 77 61 72 65 20 77 68 69 | 63 68 0d 20 6d 69 67 68 |ware whi|ch. migh|
|00000a20| 74 20 61 6c 74 65 72 20 | 74 68 65 20 63 75 72 72 |t alter |the curr|
|00000a30| 65 6e 74 20 70 6f 72 74 | 20 28 73 75 63 68 20 61 |ent port| (such a|
|00000a40| 73 20 74 68 65 20 62 75 | 67 20 28 66 65 61 74 75 |s the bu|g (featu|
|00000a50| 72 65 3f 29 20 69 6e 20 | 6d 61 6e 79 20 64 65 73 |re?) in |many des|
|00000a60| 6b 20 61 63 63 65 73 73 | 6f 72 69 65 73 0d 20 77 |k access|ories. w|
|00000a70| 68 69 63 68 20 63 68 61 | 6e 67 65 20 74 68 65 20 |hich cha|nge the |
|00000a80| 70 6f 72 74 20 6f 6e 20 | 4f 70 65 6e 44 65 73 6b |port on |OpenDesk|
|00000a90| 41 63 63 29 2e 20 20 48 | 6f 70 65 66 75 6c 6c 79 |Acc). H|opefully|
|00000aa0| 2c 20 74 68 69 73 20 61 | 6c 73 6f 20 6d 61 6b 65 |, this a|lso make|
|00000ab0| 73 20 74 68 65 20 72 6f | 75 74 69 6e 65 73 0d 20 |s the ro|utines. |
|00000ac0| 66 72 6f 6d 20 74 68 69 | 73 20 70 72 6f 67 72 61 |from thi|s progra|
|00000ad0| 6d 20 6d 6f 72 65 20 73 | 65 6c 66 2d 63 6f 6e 74 |m more s|elf-cont|
|00000ae0| 61 69 6e 65 64 2c 20 73 | 69 6e 63 65 20 74 68 65 |ained, s|ince the|
|00000af0| 79 20 64 6f 6e 27 74 20 | 64 65 70 65 6e 64 20 6f |y don't |depend o|
|00000b00| 6e 20 74 68 65 20 63 75 | 72 72 65 6e 74 0d 20 70 |n the cu|rrent. p|
|00000b10| 6f 72 74 20 73 65 74 74 | 69 6e 67 2e 7d 0d 0d 0d |ort sett|ing.}...|
|00000b20| 55 53 45 53 0d 09 4d 65 | 6d 54 79 70 65 73 2c 20 |USES..Me|mTypes, |
|00000b30| 51 75 69 63 6b 44 72 61 | 77 2c 20 4f 53 49 6e 74 |QuickDra|w, OSInt|
|00000b40| 66 2c 20 54 6f 6f 6c 49 | 6e 74 66 2c 20 50 61 63 |f, ToolI|ntf, Pac|
|00000b50| 6b 49 6e 74 66 2c 20 54 | 72 61 70 73 3b 0d 0d 43 |kIntf, T|raps;..C|
|00000b60| 4f 4e 53 54 0d 0d 09 6b | 53 79 73 45 6e 76 69 72 |ONST...k|SysEnvir|
|00000b70| 6f 6e 73 56 65 72 73 69 | 6f 6e 09 09 3d 20 31 3b |onsVersi|on..= 1;|
|00000b80| 0d 0d 09 6b 4f 53 45 76 | 65 6e 74 09 09 09 09 3d |...kOSEv|ent....=|
|00000b90| 20 61 70 70 34 45 76 74 | 3b 09 7b 65 76 65 6e 74 | app4Evt|;.{event|
|00000ba0| 20 75 73 65 64 20 62 79 | 20 4d 75 6c 74 69 46 69 | used by| MultiFi|
|00000bb0| 6e 64 65 72 7d 0d 09 6b | 53 75 73 70 65 6e 64 52 |nder}..k|SuspendR|
|00000bc0| 65 73 75 6d 65 4d 65 73 | 73 61 67 65 09 3d 20 31 |esumeMes|sage.= 1|
|00000bd0| 3b 09 09 7b 68 69 67 68 | 20 62 79 74 65 20 6f 66 |;..{high| byte of|
|00000be0| 20 73 75 73 70 65 6e 64 | 2f 72 65 73 75 6d 65 20 | suspend|/resume |
|00000bf0| 65 76 65 6e 74 20 6d 65 | 73 73 61 67 65 7d 0d 09 |event me|ssage}..|
|00000c00| 6b 52 65 73 75 6d 65 4d | 61 73 6b 09 09 09 09 3d |kResumeM|ask....=|
|00000c10| 20 31 3b 09 09 7b 62 69 | 74 20 6f 66 20 6d 65 73 | 1;..{bi|t of mes|
|00000c20| 73 61 67 65 20 66 69 65 | 6c 64 20 66 6f 72 20 72 |sage fie|ld for r|
|00000c30| 65 73 75 6d 65 20 76 73 | 2e 20 73 75 73 70 65 6e |esume vs|. suspen|
|00000c40| 64 7d 0d 09 6b 4e 6f 45 | 76 65 6e 74 73 09 09 09 |d}..kNoE|vents...|
|00000c50| 09 3d 20 30 3b 09 09 7b | 6e 6f 20 65 76 65 6e 74 |.= 0;..{|no event|
|00000c60| 73 20 6d 61 73 6b 7d 0d | 09 20 0d 09 6b 4d 69 6e |s mask}.|. ..kMin|
|00000c70| 48 65 61 70 09 3d 20 32 | 31 20 2a 20 31 30 32 34 |Heap.= 2|1 * 1024|
|00000c80| 3b 0d 09 20 0d 09 6b 4d | 69 6e 53 70 61 63 65 09 |;.. ..kM|inSpace.|
|00000c90| 3d 20 38 20 2a 20 31 30 | 32 34 3b 0d 09 0d 09 7b |= 8 * 10|24;....{|
|00000ca0| 6b 45 78 74 72 65 6d 65 | 4e 65 67 20 61 6e 64 20 |kExtreme|Neg and |
|00000cb0| 6b 45 78 74 72 65 6d 65 | 50 6f 73 20 61 72 65 20 |kExtreme|Pos are |
|00000cc0| 75 73 65 64 20 74 6f 20 | 73 65 74 20 75 70 20 77 |used to |set up w|
|00000cd0| 69 64 65 20 6f 70 65 6e | 20 72 65 63 74 61 6e 67 |ide open| rectang|
|00000ce0| 6c 65 73 20 61 6e 64 20 | 72 65 67 69 6f 6e 73 2e |les and |regions.|
|00000cf0| 7d 0d 09 6b 45 78 74 72 | 65 6d 65 4e 65 67 09 3d |}..kExtr|emeNeg.=|
|00000d00| 20 2d 33 32 37 36 38 3b | 0d 09 6b 45 78 74 72 65 | -32768;|..kExtre|
|00000d10| 6d 65 50 6f 73 09 3d 20 | 33 32 37 36 37 20 2d 20 |mePos.= |32767 - |
|00000d20| 31 3b 09 09 09 7b 72 65 | 71 75 69 72 65 64 20 66 |1;...{re|quired f|
|00000d30| 6f 72 20 6f 6c 64 20 72 | 65 67 69 6f 6e 20 62 75 |or old r|egion bu|
|00000d40| 67 7d 0d 09 0d 09 7b 54 | 68 65 73 65 20 63 6f 6e |g}....{T|hese con|
|00000d50| 73 74 61 6e 74 73 20 61 | 72 65 20 61 6c 6c 20 72 |stants a|re all r|
|00000d60| 65 73 6f 75 72 63 65 20 | 49 44 73 2c 20 63 6f 72 |esource |IDs, cor|
|00000d70| 72 65 73 70 6f 6e 64 69 | 6e 67 20 74 6f 20 72 65 |respondi|ng to re|
|00000d80| 73 6f 75 72 63 65 73 20 | 69 6e 20 53 61 6d 70 6c |sources |in Sampl|
|00000d90| 65 2e 72 2e 7d 0d 09 72 | 4d 65 6e 75 42 61 72 09 |e.r.}..r|MenuBar.|
|00000da0| 3d 20 31 32 38 3b 09 09 | 09 09 09 7b 61 70 70 6c |= 128;..|...{appl|
|00000db0| 69 63 61 74 69 6f 6e 27 | 73 20 6d 65 6e 75 20 62 |ication'|s menu b|
|00000dc0| 61 72 7d 0d 09 72 41 62 | 6f 75 74 41 6c 65 72 74 |ar}..rAb|outAlert|
|00000dd0| 09 3d 20 31 32 38 3b 09 | 09 09 09 09 7b 61 62 6f |.= 128;.|....{abo|
|00000de0| 75 74 20 61 6c 65 72 74 | 7d 0d 09 72 55 73 65 72 |ut alert|}..rUser|
|00000df0| 41 6c 65 72 74 09 3d 20 | 31 32 39 3b 09 09 09 09 |Alert.= |129;....|
|00000e00| 09 7b 65 72 72 6f 72 20 | 75 73 65 72 20 61 6c 65 |.{error |user ale|
|00000e10| 72 74 7d 0d 09 72 57 69 | 6e 64 6f 77 09 09 3d 20 |rt}..rWi|ndow..= |
|00000e20| 31 32 38 3b 09 09 09 09 | 09 7b 61 70 70 6c 69 63 |128;....|.{applic|
|00000e30| 61 74 69 6f 6e 27 73 20 | 77 69 6e 64 6f 77 7d 0d |ation's |window}.|
|00000e40| 09 72 53 74 6f 70 52 65 | 63 74 09 3d 20 31 32 38 |.rStopRe|ct.= 128|
|00000e50| 3b 09 09 09 09 09 7b 72 | 65 63 74 61 6e 67 6c 65 |;.....{r|ectangle|
|00000e60| 20 66 6f 72 20 53 74 6f | 70 20 6c 69 67 68 74 7d | for Sto|p light}|
|00000e70| 0d 09 72 47 6f 52 65 63 | 74 09 09 3d 20 31 32 39 |..rGoRec|t..= 129|
|00000e80| 3b 09 09 09 09 09 7b 72 | 65 63 74 61 6e 67 6c 65 |;.....{r|ectangle|
|00000e90| 20 66 6f 72 20 47 6f 20 | 6c 69 67 68 74 7d 0d 0d | for Go |light}..|
|00000ea0| 09 7b 54 68 65 73 65 20 | 63 6f 6e 73 74 61 6e 74 |.{These |constant|
|00000eb0| 73 20 61 72 65 20 75 73 | 65 64 20 74 6f 20 69 64 |s are us|ed to id|
|00000ec0| 65 6e 74 69 66 79 20 6d | 65 6e 75 73 20 61 6e 64 |entify m|enus and|
|00000ed0| 20 74 68 65 69 72 20 69 | 74 65 6d 73 2e 20 54 68 | their i|tems. Th|
|00000ee0| 65 20 6d 65 6e 75 20 49 | 44 73 0d 09 20 68 61 76 |e menu I|Ds.. hav|
|00000ef0| 65 20 61 6e 20 22 6d 22 | 20 70 72 65 66 69 78 20 |e an "m"| prefix |
|00000f00| 61 6e 64 20 74 68 65 20 | 69 74 65 6d 20 6e 75 6d |and the |item num|
|00000f10| 62 65 72 73 20 77 69 74 | 68 69 6e 20 65 61 63 68 |bers wit|hin each|
|00000f20| 20 6d 65 6e 75 20 68 61 | 76 65 20 61 6e 20 22 69 | menu ha|ve an "i|
|00000f30| 22 20 70 72 65 66 69 78 | 2e 7d 0d 09 6d 41 70 70 |" prefix|.}..mApp|
|00000f40| 6c 65 09 09 3d 20 31 32 | 38 3b 09 09 09 09 09 7b |le..= 12|8;.....{|
|00000f50| 41 70 70 6c 65 20 6d 65 | 6e 75 7d 0d 09 69 41 62 |Apple me|nu}..iAb|
|00000f60| 6f 75 74 09 09 3d 20 31 | 3b 0d 0d 09 6d 46 69 6c |out..= 1|;...mFil|
|00000f70| 65 09 09 3d 20 31 32 39 | 3b 09 09 09 09 09 7b 46 |e..= 129|;.....{F|
|00000f80| 69 6c 65 20 6d 65 6e 75 | 7d 0d 09 69 4e 65 77 09 |ile menu|}..iNew.|
|00000f90| 09 3d 20 31 3b 0d 09 69 | 43 6c 6f 73 65 09 09 3d |.= 1;..i|Close..=|
|00000fa0| 20 34 3b 0d 09 69 51 75 | 69 74 09 09 3d 20 31 32 | 4;..iQu|it..= 12|
|00000fb0| 3b 0d 0d 09 6d 45 64 69 | 74 09 09 3d 20 31 33 30 |;...mEdi|t..= 130|
|00000fc0| 3b 09 09 09 09 09 7b 45 | 64 69 74 20 6d 65 6e 75 |;.....{E|dit menu|
|00000fd0| 7d 0d 09 69 55 6e 64 6f | 09 09 3d 20 31 3b 0d 09 |}..iUndo|..= 1;..|
|00000fe0| 69 43 75 74 09 09 3d 20 | 33 3b 0d 09 69 43 6f 70 |iCut..= |3;..iCop|
|00000ff0| 79 09 09 3d 20 34 3b 0d | 09 69 50 61 73 74 65 09 |y..= 4;.|.iPaste.|
|00001000| 09 3d 20 35 3b 0d 09 69 | 43 6c 65 61 72 09 09 3d |.= 5;..i|Clear..=|
|00001010| 20 36 3b 0d 0d 09 6d 4c | 69 67 68 74 09 09 3d 20 | 6;...mL|ight..= |
|00001020| 31 33 31 3b 09 09 09 09 | 09 7b 4c 69 67 68 74 20 |131;....|.{Light |
|00001030| 6d 65 6e 75 7d 0d 09 69 | 53 74 6f 70 09 09 3d 20 |menu}..i|Stop..= |
|00001040| 31 3b 0d 09 69 47 6f 09 | 09 09 3d 20 32 3b 0d 09 |1;..iGo.|..= 2;..|
|00001050| 0d 09 7b 31 2e 30 31 20 | 2d 20 6b 44 49 54 6f 70 |..{1.01 |- kDITop|
|00001060| 20 61 6e 64 20 6b 44 49 | 4c 65 66 74 20 61 72 65 | and kDI|Left are|
|00001070| 20 75 73 65 64 20 74 6f | 20 6c 6f 63 61 74 65 20 | used to| locate |
|00001080| 74 68 65 20 44 69 73 6b | 20 49 6e 69 74 69 61 6c |the Disk| Initial|
|00001090| 69 7a 61 74 69 6f 6e 20 | 64 69 61 6c 6f 67 73 2e |ization |dialogs.|
|000010a0| 7d 0d 09 6b 44 49 54 6f | 70 09 09 3d 20 24 30 30 |}..kDITo|p..= $00|
|000010b0| 35 30 3b 0d 09 6b 44 49 | 4c 65 66 74 09 09 3d 20 |50;..kDI|Left..= |
|000010c0| 24 30 30 37 30 3b 0d 0d | 0d 56 41 52 0d 09 7b 54 |$0070;..|.VAR..{T|
|000010d0| 68 65 20 22 67 22 20 70 | 72 65 66 69 78 20 69 73 |he "g" p|refix is|
|000010e0| 20 75 73 65 64 20 74 6f | 20 65 6d 70 68 61 73 69 | used to| emphasi|
|000010f0| 7a 65 20 74 68 61 74 20 | 61 20 76 61 72 69 61 62 |ze that |a variab|
|00001100| 6c 65 20 69 73 20 67 6c | 6f 62 61 6c 2e 7d 0d 0d |le is gl|obal.}..|
|00001110| 09 67 4d 61 63 09 09 09 | 09 3a 20 53 79 73 45 6e |.gMac...|.: SysEn|
|00001120| 76 52 65 63 3b 09 7b 73 | 65 74 20 75 70 20 62 79 |vRec;.{s|et up by|
|00001130| 20 49 6e 69 74 69 61 6c | 69 7a 65 7d 0d 09 67 48 | Initial|ize}..gH|
|00001140| 61 73 57 61 69 74 4e 65 | 78 74 45 76 65 6e 74 09 |asWaitNe|xtEvent.|
|00001150| 3a 20 42 4f 4f 4c 45 41 | 4e 3b 09 09 7b 73 65 74 |: BOOLEA|N;..{set|
|00001160| 20 75 70 20 62 79 20 49 | 6e 69 74 69 61 6c 69 7a | up by I|nitializ|
|00001170| 65 7d 0d 09 67 49 6e 42 | 61 63 6b 67 72 6f 75 6e |e}..gInB|ackgroun|
|00001180| 64 09 09 3a 20 42 4f 4f | 4c 45 41 4e 3b 09 09 7b |d..: BOO|LEAN;..{|
|00001190| 6d 61 69 6e 74 61 69 6e | 65 64 20 62 79 20 49 6e |maintain|ed by In|
|000011a0| 69 74 69 61 6c 69 7a 65 | 20 61 6e 64 20 44 6f 45 |itialize| and DoE|
|000011b0| 76 65 6e 74 7d 0d 09 67 | 53 74 6f 70 70 65 64 09 |vent}..g|Stopped.|
|000011c0| 09 09 3a 20 42 4f 4f 4c | 45 41 4e 3b 09 09 7b 6d |..: BOOL|EAN;..{m|
|000011d0| 61 69 6e 74 61 69 6e 65 | 64 20 62 79 20 49 6e 69 |aintaine|d by Ini|
|000011e0| 74 69 61 6c 69 7a 65 20 | 61 6e 64 20 53 65 74 4c |tialize |and SetL|
|000011f0| 69 67 68 74 7d 0d 09 67 | 53 74 6f 70 52 65 63 74 |ight}..g|StopRect|
|00001200| 09 09 09 3a 20 52 65 63 | 74 3b 09 09 09 7b 73 65 |...: Rec|t;...{se|
|00001210| 74 20 75 70 20 62 79 20 | 49 6e 69 74 69 61 6c 69 |t up by |Initiali|
|00001220| 7a 65 7d 0d 09 67 47 6f | 52 65 63 74 09 09 09 09 |ze}..gGo|Rect....|
|00001230| 3a 20 52 65 63 74 3b 09 | 09 09 7b 73 65 74 20 75 |: Rect;.|..{set u|
|00001240| 70 20 62 79 20 49 6e 69 | 74 69 61 6c 69 7a 65 7d |p by Ini|tialize}|
|00001250| 0d 0d 0d 7b 24 53 20 49 | 6e 69 74 69 61 6c 69 7a |...{$S I|nitializ|
|00001260| 65 7d 0d 46 55 4e 43 54 | 49 4f 4e 20 54 72 61 70 |e}.FUNCT|ION Trap|
|00001270| 41 76 61 69 6c 61 62 6c | 65 28 74 4e 75 6d 62 65 |Availabl|e(tNumbe|
|00001280| 72 3a 20 49 4e 54 45 47 | 45 52 3b 20 74 54 79 70 |r: INTEG|ER; tTyp|
|00001290| 65 3a 20 54 72 61 70 54 | 79 70 65 29 3a 20 42 4f |e: TrapT|ype): BO|
|000012a0| 4f 4c 45 41 4e 3b 0d 0d | 42 45 47 49 4e 0d 09 49 |OLEAN;..|BEGIN..I|
|000012b0| 46 20 28 74 54 79 70 65 | 20 3d 20 54 6f 6f 6c 54 |F (tType| = ToolT|
|000012c0| 72 61 70 29 20 26 0d 09 | 09 28 67 4d 61 63 2e 6d |rap) &..|.(gMac.m|
|000012d0| 61 63 68 69 6e 65 54 79 | 70 65 20 3e 20 65 6e 76 |achineTy|pe > env|
|000012e0| 4d 61 63 68 55 6e 6b 6e | 6f 77 6e 29 20 26 0d 09 |MachUnkn|own) &..|
|000012f0| 09 28 67 4d 61 63 2e 6d | 61 63 68 69 6e 65 54 79 |.(gMac.m|achineTy|
|00001300| 70 65 20 3c 20 65 6e 76 | 4d 61 63 49 49 29 20 54 |pe < env|MacII) T|
|00001310| 48 45 4e 20 42 45 47 49 | 4e 09 09 7b 69 74 27 73 |HEN BEGI|N..{it's|
|00001320| 20 61 20 35 31 32 4b 45 | 2c 20 50 6c 75 73 2c 20 | a 512KE|, Plus, |
|00001330| 6f 72 20 53 45 7d 0d 09 | 09 74 4e 75 6d 62 65 72 |or SE}..|.tNumber|
|00001340| 20 3a 3d 20 42 41 4e 44 | 28 74 4e 75 6d 62 65 72 | := BAND|(tNumber|
|00001350| 2c 20 24 30 33 46 46 29 | 3b 0d 09 09 49 46 20 74 |, $03FF)|;...IF t|
|00001360| 4e 75 6d 62 65 72 20 3e | 20 24 30 31 46 46 20 54 |Number >| $01FF T|
|00001370| 48 45 4e 09 09 09 09 09 | 09 09 7b 77 68 69 63 68 |HEN.....|..{which|
|00001380| 20 6d 65 61 6e 73 20 74 | 68 65 20 74 6f 6f 6c 20 | means t|he tool |
|00001390| 74 72 61 70 73 7d 0d 09 | 09 09 74 4e 75 6d 62 65 |traps}..|..tNumbe|
|000013a0| 72 20 3a 3d 20 5f 55 6e | 69 6d 70 6c 65 6d 65 6e |r := _Un|implemen|
|000013b0| 74 65 64 3b 09 09 09 09 | 09 7b 6f 6e 6c 79 20 67 |ted;....|.{only g|
|000013c0| 6f 20 74 6f 20 24 30 31 | 46 46 7d 0d 09 45 4e 44 |o to $01|FF}..END|
|000013d0| 3b 0d 09 54 72 61 70 41 | 76 61 69 6c 61 62 6c 65 |;..TrapA|vailable|
|000013e0| 20 3a 3d 20 4e 47 65 74 | 54 72 61 70 41 64 64 72 | := NGet|TrapAddr|
|000013f0| 65 73 73 28 74 4e 75 6d | 62 65 72 2c 20 74 54 79 |ess(tNum|ber, tTy|
|00001400| 70 65 29 20 3c 3e 0d 09 | 09 09 09 09 09 47 65 74 |pe) <>..|.....Get|
|00001410| 54 72 61 70 41 64 64 72 | 65 73 73 28 5f 55 6e 69 |TrapAddr|ess(_Uni|
|00001420| 6d 70 6c 65 6d 65 6e 74 | 65 64 29 3b 0d 45 4e 44 |mplement|ed);.END|
|00001430| 3b 20 7b 54 72 61 70 41 | 76 61 69 6c 61 62 6c 65 |; {TrapA|vailable|
|00001440| 7d 0d 0d 0d 7b 24 53 20 | 4d 61 69 6e 7d 0d 46 55 |}...{$S |Main}.FU|
|00001450| 4e 43 54 49 4f 4e 20 49 | 73 44 41 57 69 6e 64 6f |NCTION I|sDAWindo|
|00001460| 77 28 77 69 6e 64 6f 77 | 3a 20 57 69 6e 64 6f 77 |w(window|: Window|
|00001470| 50 74 72 29 3a 20 42 4f | 4f 4c 45 41 4e 3b 0d 0d |Ptr): BO|OLEAN;..|
|00001480| 7b 43 68 65 63 6b 20 69 | 66 20 61 20 77 69 6e 64 |{Check i|f a wind|
|00001490| 6f 77 20 62 65 6c 6f 6e | 67 73 20 74 6f 20 61 20 |ow belon|gs to a |
|000014a0| 64 65 73 6b 20 61 63 63 | 65 73 73 6f 72 79 2e 7d |desk acc|essory.}|
|000014b0| 0d 0d 42 45 47 49 4e 0d | 09 49 46 20 77 69 6e 64 |..BEGIN.|.IF wind|
|000014c0| 6f 77 20 3d 20 4e 49 4c | 20 54 48 45 4e 0d 09 09 |ow = NIL| THEN...|
|000014d0| 49 73 44 41 57 69 6e 64 | 6f 77 20 3a 3d 20 46 41 |IsDAWind|ow := FA|
|000014e0| 4c 53 45 0d 09 45 4c 53 | 45 09 7b 44 41 20 77 69 |LSE..ELS|E.{DA wi|
|000014f0| 6e 64 6f 77 73 20 68 61 | 76 65 20 6e 65 67 61 74 |ndows ha|ve negat|
|00001500| 69 76 65 20 77 69 6e 64 | 6f 77 4b 69 6e 64 73 7d |ive wind|owKinds}|
|00001510| 0d 09 09 49 73 44 41 57 | 69 6e 64 6f 77 20 3a 3d |...IsDAW|indow :=|
|00001520| 20 57 69 6e 64 6f 77 50 | 65 65 6b 28 77 69 6e 64 | WindowP|eek(wind|
|00001530| 6f 77 29 5e 2e 77 69 6e | 64 6f 77 4b 69 6e 64 20 |ow)^.win|dowKind |
|00001540| 3c 20 30 3b 0d 45 4e 44 | 3b 20 7b 49 73 44 41 57 |< 0;.END|; {IsDAW|
|00001550| 69 6e 64 6f 77 7d 0d 0d | 0d 7b 24 53 20 4d 61 69 |indow}..|.{$S Mai|
|00001560| 6e 7d 0d 46 55 4e 43 54 | 49 4f 4e 20 49 73 41 70 |n}.FUNCT|ION IsAp|
|00001570| 70 57 69 6e 64 6f 77 28 | 77 69 6e 64 6f 77 3a 20 |pWindow(|window: |
|00001580| 57 69 6e 64 6f 77 50 74 | 72 29 3a 20 42 4f 4f 4c |WindowPt|r): BOOL|
|00001590| 45 41 4e 3b 0d 0d 42 45 | 47 49 4e 0d 09 49 46 20 |EAN;..BE|GIN..IF |
|000015a0| 77 69 6e 64 6f 77 20 3d | 20 4e 49 4c 20 54 48 45 |window =| NIL THE|
|000015b0| 4e 0d 09 09 49 73 41 70 | 70 57 69 6e 64 6f 77 20 |N...IsAp|pWindow |
|000015c0| 3a 3d 20 46 41 4c 53 45 | 0d 09 45 4c 53 45 09 7b |:= FALSE|..ELSE.{|
|000015d0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 77 69 6e 64 |applicat|ion wind|
|000015e0| 6f 77 73 20 68 61 76 65 | 20 77 69 6e 64 6f 77 4b |ows have| windowK|
|000015f0| 69 6e 64 73 20 3d 20 75 | 73 65 72 4b 69 6e 64 20 |inds = u|serKind |
|00001600| 28 38 29 7d 0d 09 09 57 | 49 54 48 20 57 69 6e 64 |(8)}...W|ITH Wind|
|00001610| 6f 77 50 65 65 6b 28 77 | 69 6e 64 6f 77 29 5e 20 |owPeek(w|indow)^ |
|00001620| 44 4f 0d 09 09 09 49 73 | 41 70 70 57 69 6e 64 6f |DO....Is|AppWindo|
|00001630| 77 20 3a 3d 20 28 77 69 | 6e 64 6f 77 4b 69 6e 64 |w := (wi|ndowKind|
|00001640| 20 3d 20 75 73 65 72 4b | 69 6e 64 29 3b 0d 45 4e | = userK|ind);.EN|
|00001650| 44 3b 20 7b 49 73 41 70 | 70 57 69 6e 64 6f 77 7d |D; {IsAp|pWindow}|
|00001660| 0d 0d 0d 7b 24 53 20 4d | 61 69 6e 7d 0d 50 52 4f |...{$S M|ain}.PRO|
|00001670| 43 45 44 55 52 45 20 41 | 6c 65 72 74 55 73 65 72 |CEDURE A|lertUser|
|00001680| 3b 0d 20 0d 56 41 52 0d | 09 69 74 65 6d 48 69 74 |;. .VAR.|.itemHit|
|00001690| 09 3a 20 49 4e 54 45 47 | 45 52 3b 0d 42 45 47 49 |.: INTEG|ER;.BEGI|
|000016a0| 4e 0d 09 53 65 74 43 75 | 72 73 6f 72 28 61 72 72 |N..SetCu|rsor(arr|
|000016b0| 6f 77 29 3b 0d 09 69 74 | 65 6d 48 69 74 20 3a 3d |ow);..it|emHit :=|
|000016c0| 20 41 6c 65 72 74 28 72 | 55 73 65 72 41 6c 65 72 | Alert(r|UserAler|
|000016d0| 74 2c 20 4e 49 4c 29 3b | 0d 09 45 78 69 74 54 6f |t, NIL);|..ExitTo|
|000016e0| 53 68 65 6c 6c 3b 0d 45 | 4e 44 3b 20 7b 41 6c 65 |Shell;.E|ND; {Ale|
|000016f0| 72 74 55 73 65 72 7d 0d | 0d 0d 7b 24 53 20 4d 61 |rtUser}.|..{$S Ma|
|00001700| 69 6e 7d 0d 46 55 4e 43 | 54 49 4f 4e 20 44 6f 43 |in}.FUNC|TION DoC|
|00001710| 6c 6f 73 65 57 69 6e 64 | 6f 77 28 77 69 6e 64 6f |loseWind|ow(windo|
|00001720| 77 3a 20 57 69 6e 64 6f | 77 50 74 72 29 20 3a 20 |w: Windo|wPtr) : |
|00001730| 42 4f 4f 4c 45 41 4e 3b | 0d 0d 7b 43 6c 6f 73 65 |BOOLEAN;|..{Close|
|00001740| 20 61 20 77 69 6e 64 6f | 77 2e 7d 0d 0d 42 45 47 | a windo|w.}..BEG|
|00001750| 49 4e 0d 09 44 6f 43 6c | 6f 73 65 57 69 6e 64 6f |IN..DoCl|oseWindo|
|00001760| 77 20 3a 3d 20 54 52 55 | 45 3b 0d 09 49 46 20 49 |w := TRU|E;..IF I|
|00001770| 73 44 41 57 69 6e 64 6f | 77 28 77 69 6e 64 6f 77 |sDAWindo|w(window|
|00001780| 29 20 54 48 45 4e 0d 09 | 09 43 6c 6f 73 65 44 65 |) THEN..|.CloseDe|
|00001790| 73 6b 41 63 63 28 57 69 | 6e 64 6f 77 50 65 65 6b |skAcc(Wi|ndowPeek|
|000017a0| 28 77 69 6e 64 6f 77 29 | 5e 2e 77 69 6e 64 6f 77 |(window)|^.window|
|000017b0| 4b 69 6e 64 29 3b 0d 09 | 49 46 20 49 73 41 70 70 |Kind);..|IF IsApp|
|000017c0| 57 69 6e 64 6f 77 28 77 | 69 6e 64 6f 77 29 20 54 |Window(w|indow) T|
|000017d0| 48 45 4e 0d 09 09 43 6c | 6f 73 65 57 69 6e 64 6f |HEN...Cl|oseWindo|
|000017e0| 77 28 77 69 6e 64 6f 77 | 29 3b 0d 45 4e 44 3b 20 |w(window|);.END; |
|000017f0| 7b 44 6f 43 6c 6f 73 65 | 57 69 6e 64 6f 77 7d 0d |{DoClose|Window}.|
|00001800| 0d 0d 7b 24 53 20 49 6e | 69 74 69 61 6c 69 7a 65 |..{$S In|itialize|
|00001810| 7d 0d 46 55 4e 43 54 49 | 4f 4e 20 47 6f 47 65 74 |}.FUNCTI|ON GoGet|
|00001820| 52 65 63 74 28 72 65 63 | 74 49 44 3a 20 49 4e 54 |Rect(rec|tID: INT|
|00001830| 45 47 45 52 3b 20 56 41 | 52 20 74 68 65 52 65 63 |EGER; VA|R theRec|
|00001840| 74 3a 20 52 65 63 74 29 | 20 3a 20 42 4f 4f 4c 45 |t: Rect)| : BOOLE|
|00001850| 41 4e 3b 0d 20 0d 54 59 | 50 45 0d 09 52 65 63 74 |AN;. .TY|PE..Rect|
|00001860| 50 74 72 09 09 3d 20 5e | 52 65 63 74 3b 0d 09 52 |Ptr..= ^|Rect;..R|
|00001870| 65 63 74 48 6e 64 09 09 | 3d 20 5e 52 65 63 74 50 |ectHnd..|= ^RectP|
|00001880| 74 72 3b 0d 56 41 52 0d | 09 72 65 73 6f 75 72 63 |tr;.VAR.|.resourc|
|00001890| 65 09 3a 20 48 61 6e 64 | 6c 65 3b 0d 42 45 47 49 |e.: Hand|le;.BEGI|
|000018a0| 4e 0d 09 72 65 73 6f 75 | 72 63 65 20 3a 3d 20 47 |N..resou|rce := G|
|000018b0| 65 74 52 65 73 6f 75 72 | 63 65 28 27 52 45 43 54 |etResour|ce('RECT|
|000018c0| 27 2c 20 72 65 63 74 49 | 44 29 3b 0d 09 49 46 20 |', rectI|D);..IF |
|000018d0| 72 65 73 6f 75 72 63 65 | 20 3c 3e 20 4e 49 4c 20 |resource| <> NIL |
|000018e0| 54 48 45 4e 20 42 45 47 | 49 4e 0d 09 09 47 6f 47 |THEN BEG|IN...GoG|
|000018f0| 65 74 52 65 63 74 20 3a | 3d 20 54 52 55 45 3b 0d |etRect :|= TRUE;.|
|00001900| 09 09 74 68 65 52 65 63 | 74 20 3a 3d 20 52 65 63 |..theRec|t := Rec|
|00001910| 74 48 6e 64 28 72 65 73 | 6f 75 72 63 65 29 5e 5e |tHnd(res|ource)^^|
|00001920| 3b 0d 09 09 45 4e 44 0d | 09 45 4c 53 45 0d 09 09 |;...END.|.ELSE...|
|00001930| 47 6f 47 65 74 52 65 63 | 74 20 3a 3d 20 46 41 4c |GoGetRec|t := FAL|
|00001940| 53 45 3b 0d 45 4e 44 3b | 20 7b 47 6f 47 65 74 52 |SE;.END;| {GoGetR|
|00001950| 65 63 74 7d 0d 0d 0d 7b | 24 53 20 49 6e 69 74 69 |ect}...{|$S Initi|
|00001960| 61 6c 69 7a 65 7d 0d 50 | 52 4f 43 45 44 55 52 45 |alize}.P|ROCEDURE|
|00001970| 20 49 6e 69 74 69 61 6c | 69 7a 65 3b 0d 0d 56 41 | Initial|ize;..VA|
|00001980| 52 0d 09 6d 65 6e 75 42 | 61 72 09 09 09 3a 20 48 |R..menuB|ar...: H|
|00001990| 61 6e 64 6c 65 3b 0d 09 | 77 69 6e 64 6f 77 09 09 |andle;..|window..|
|000019a0| 09 3a 20 57 69 6e 64 6f | 77 50 74 72 3b 0d 09 69 |.: Windo|wPtr;..i|
|000019b0| 67 6e 6f 72 65 45 72 72 | 6f 72 09 09 3a 20 4f 53 |gnoreErr|or..: OS|
|000019c0| 45 72 72 3b 0d 09 74 6f | 74 61 6c 2c 20 63 6f 6e |Err;..to|tal, con|
|000019d0| 74 69 67 09 3a 20 4c 6f | 6e 67 49 6e 74 3b 0d 09 |tig.: Lo|ngInt;..|
|000019e0| 69 67 6e 6f 72 65 52 65 | 73 75 6c 74 09 3a 20 42 |ignoreRe|sult.: B|
|000019f0| 4f 4f 4c 45 41 4e 3b 0d | 09 65 76 65 6e 74 09 09 |OOLEAN;.|.event..|
|00001a00| 09 3a 20 45 76 65 6e 74 | 52 65 63 6f 72 64 3b 0d |.: Event|Record;.|
|00001a10| 09 63 6f 75 6e 74 09 09 | 09 3a 20 49 4e 54 45 47 |.count..|.: INTEG|
|00001a20| 45 52 3b 0d 0d 42 45 47 | 49 4e 0d 09 67 49 6e 42 |ER;..BEG|IN..gInB|
|00001a30| 61 63 6b 67 72 6f 75 6e | 64 20 3a 3d 20 46 41 4c |ackgroun|d := FAL|
|00001a40| 53 45 3b 0d 0d 09 49 6e | 69 74 47 72 61 66 28 40 |SE;...In|itGraf(@|
|00001a50| 74 68 65 50 6f 72 74 29 | 3b 0d 09 49 6e 69 74 46 |thePort)|;..InitF|
|00001a60| 6f 6e 74 73 3b 0d 09 49 | 6e 69 74 57 69 6e 64 6f |onts;..I|nitWindo|
|00001a70| 77 73 3b 0d 09 49 6e 69 | 74 4d 65 6e 75 73 3b 0d |ws;..Ini|tMenus;.|
|00001a80| 09 54 45 49 6e 69 74 3b | 0d 09 49 6e 69 74 44 69 |.TEInit;|..InitDi|
|00001a90| 61 6c 6f 67 73 28 4e 49 | 4c 29 3b 0d 09 49 6e 69 |alogs(NI|L);..Ini|
|00001aa0| 74 43 75 72 73 6f 72 3b | 0d 09 20 0d 09 46 4f 52 |tCursor;|.. ..FOR|
|00001ab0| 20 63 6f 75 6e 74 20 3a | 3d 20 31 20 54 4f 20 33 | count :|= 1 TO 3|
|00001ac0| 20 44 4f 0d 09 09 69 67 | 6e 6f 72 65 52 65 73 75 | DO...ig|noreResu|
|00001ad0| 6c 74 20 3a 3d 20 45 76 | 65 6e 74 41 76 61 69 6c |lt := Ev|entAvail|
|00001ae0| 28 65 76 65 72 79 45 76 | 65 6e 74 2c 20 65 76 65 |(everyEv|ent, eve|
|00001af0| 6e 74 29 3b 0d 09 09 20 | 0d 09 69 67 6e 6f 72 65 |nt);... |..ignore|
|00001b00| 45 72 72 6f 72 20 3a 3d | 20 53 79 73 45 6e 76 69 |Error :=| SysEnvi|
|00001b10| 72 6f 6e 73 28 6b 53 79 | 73 45 6e 76 69 72 6f 6e |rons(kSy|sEnviron|
|00001b20| 73 56 65 72 73 69 6f 6e | 2c 20 67 4d 61 63 29 3b |sVersion|, gMac);|
|00001b30| 0d 09 0d 09 7b 4d 61 6b | 65 20 73 75 72 65 20 74 |....{Mak|e sure t|
|00001b40| 68 61 74 20 74 68 65 20 | 6d 61 63 68 69 6e 65 20 |hat the |machine |
|00001b50| 68 61 73 20 61 74 20 6c | 65 61 73 74 20 31 32 38 |has at l|east 128|
|00001b60| 4b 20 52 4f 4d 73 2e 20 | 49 66 20 69 74 20 64 6f |K ROMs. |If it do|
|00001b70| 65 73 6e 27 74 2c 20 65 | 78 69 74 2e 7d 0d 09 0d |esn't, e|xit.}...|
|00001b80| 09 49 46 20 67 4d 61 63 | 2e 6d 61 63 68 69 6e 65 |.IF gMac|.machine|
|00001b90| 54 79 70 65 20 3c 20 30 | 20 54 48 45 4e 20 41 6c |Type < 0| THEN Al|
|00001ba0| 65 72 74 55 73 65 72 3b | 0d 09 09 20 0d 09 67 48 |ertUser;|... ..gH|
|00001bb0| 61 73 57 61 69 74 4e 65 | 78 74 45 76 65 6e 74 20 |asWaitNe|xtEvent |
|00001bc0| 3a 3d 20 54 72 61 70 41 | 76 61 69 6c 61 62 6c 65 |:= TrapA|vailable|
|00001bd0| 28 5f 57 61 69 74 4e 65 | 78 74 45 76 65 6e 74 2c |(_WaitNe|xtEvent,|
|00001be0| 20 54 6f 6f 6c 54 72 61 | 70 29 3b 0d 09 20 0d 09 | ToolTra|p);.. ..|
|00001bf0| 49 46 20 4f 52 44 28 47 | 65 74 41 70 70 6c 4c 69 |IF ORD(G|etApplLi|
|00001c00| 6d 69 74 29 20 2d 20 4f | 52 44 28 41 70 70 6c 69 |mit) - O|RD(Appli|
|00001c10| 63 5a 6f 6e 65 29 20 3c | 20 6b 4d 69 6e 48 65 61 |cZone) <| kMinHea|
|00001c20| 70 20 54 48 45 4e 20 41 | 6c 65 72 74 55 73 65 72 |p THEN A|lertUser|
|00001c30| 3b 0d 09 09 20 0d 09 50 | 75 72 67 65 53 70 61 63 |;... ..P|urgeSpac|
|00001c40| 65 28 74 6f 74 61 6c 2c | 20 63 6f 6e 74 69 67 29 |e(total,| contig)|
|00001c50| 3b 0d 09 49 46 20 74 6f | 74 61 6c 20 3c 20 6b 4d |;..IF to|tal < kM|
|00001c60| 69 6e 53 70 61 63 65 20 | 54 48 45 4e 20 41 6c 65 |inSpace |THEN Ale|
|00001c70| 72 74 55 73 65 72 3b 0d | 0d 09 77 69 6e 64 6f 77 |rtUser;.|..window|
|00001c80| 20 3a 3d 20 57 69 6e 64 | 6f 77 50 74 72 28 4e 65 | := Wind|owPtr(Ne|
|00001c90| 77 50 74 72 28 53 49 5a | 45 4f 46 28 57 69 6e 64 |wPtr(SIZ|EOF(Wind|
|00001ca0| 6f 77 52 65 63 6f 72 64 | 29 29 29 3b 0d 09 49 46 |owRecord|)));..IF|
|00001cb0| 20 77 69 6e 64 6f 77 20 | 3d 20 4e 49 4c 20 54 48 | window |= NIL TH|
|00001cc0| 45 4e 20 41 6c 65 72 74 | 55 73 65 72 3b 0d 09 77 |EN Alert|User;..w|
|00001cd0| 69 6e 64 6f 77 20 3a 3d | 20 47 65 74 4e 65 77 57 |indow :=| GetNewW|
|00001ce0| 69 6e 64 6f 77 28 72 57 | 69 6e 64 6f 77 2c 20 50 |indow(rW|indow, P|
|00001cf0| 74 72 28 77 69 6e 64 6f | 77 29 2c 20 57 69 6e 64 |tr(windo|w), Wind|
|00001d00| 6f 77 50 74 72 28 2d 31 | 29 29 3b 0d 0d 09 6d 65 |owPtr(-1|));...me|
|00001d10| 6e 75 42 61 72 20 3a 3d | 20 47 65 74 4e 65 77 4d |nuBar :=| GetNewM|
|00001d20| 42 61 72 28 72 4d 65 6e | 75 42 61 72 29 3b 09 09 |Bar(rMen|uBar);..|
|00001d30| 7b 72 65 61 64 20 6d 65 | 6e 75 73 20 69 6e 74 6f |{read me|nus into|
|00001d40| 20 6d 65 6e 75 20 62 61 | 72 7d 0d 09 49 46 20 6d | menu ba|r}..IF m|
|00001d50| 65 6e 75 42 61 72 20 3d | 20 4e 49 4c 20 54 48 45 |enuBar =| NIL THE|
|00001d60| 4e 20 41 6c 65 72 74 55 | 73 65 72 3b 0d 09 53 65 |N AlertU|ser;..Se|
|00001d70| 74 4d 65 6e 75 42 61 72 | 28 6d 65 6e 75 42 61 72 |tMenuBar|(menuBar|
|00001d80| 29 3b 09 09 09 09 09 7b | 69 6e 73 74 61 6c 6c 20 |);.....{|install |
|00001d90| 6d 65 6e 75 73 7d 0d 09 | 44 69 73 70 6f 73 48 61 |menus}..|DisposHa|
|00001da0| 6e 64 6c 65 28 6d 65 6e | 75 42 61 72 29 3b 0d 09 |ndle(men|uBar);..|
|00001db0| 41 64 64 52 65 73 4d 65 | 6e 75 28 47 65 74 4d 48 |AddResMe|nu(GetMH|
|00001dc0| 61 6e 64 6c 65 28 6d 41 | 70 70 6c 65 29 2c 20 27 |andle(mA|pple), '|
|00001dd0| 44 52 56 52 27 29 3b 09 | 7b 61 64 64 20 44 41 20 |DRVR');.|{add DA |
|00001de0| 6e 61 6d 65 73 20 74 6f | 20 41 70 70 6c 65 20 6d |names to| Apple m|
|00001df0| 65 6e 75 7d 0d 09 44 72 | 61 77 4d 65 6e 75 42 61 |enu}..Dr|awMenuBa|
|00001e00| 72 3b 0d 0d 09 67 53 74 | 6f 70 70 65 64 20 3a 3d |r;...gSt|opped :=|
|00001e10| 20 54 52 55 45 3b 0d 09 | 49 46 20 4e 4f 54 20 47 | TRUE;..|IF NOT G|
|00001e20| 6f 47 65 74 52 65 63 74 | 28 72 53 74 6f 70 52 65 |oGetRect|(rStopRe|
|00001e30| 63 74 2c 20 67 53 74 6f | 70 52 65 63 74 29 20 54 |ct, gSto|pRect) T|
|00001e40| 48 45 4e 0d 09 09 41 6c | 65 72 74 55 73 65 72 3b |HEN...Al|ertUser;|
|00001e50| 09 09 09 09 09 09 09 7b | 74 68 65 20 73 74 6f 70 |.......{|the stop|
|00001e60| 20 6c 69 67 68 74 20 72 | 65 63 74 61 6e 67 6c 65 | light r|ectangle|
|00001e70| 7d 0d 09 49 46 20 4e 4f | 54 20 47 6f 47 65 74 52 |}..IF NO|T GoGetR|
|00001e80| 65 63 74 28 72 47 6f 52 | 65 63 74 2c 20 67 47 6f |ect(rGoR|ect, gGo|
|00001e90| 52 65 63 74 29 20 54 48 | 45 4e 0d 09 09 41 6c 65 |Rect) TH|EN...Ale|
|00001ea0| 72 74 55 73 65 72 3b 09 | 09 09 09 09 09 09 7b 74 |rtUser;.|......{t|
|00001eb0| 68 65 20 67 6f 20 6c 69 | 67 68 74 20 72 65 63 74 |he go li|ght rect|
|00001ec0| 61 6e 67 6c 65 7d 0d 45 | 4e 44 3b 20 7b 49 6e 69 |angle}.E|ND; {Ini|
|00001ed0| 74 69 61 6c 69 7a 65 7d | 0d 0d 0d 7b 24 53 20 4d |tialize}|...{$S M|
|00001ee0| 61 69 6e 7d 0d 50 52 4f | 43 45 44 55 52 45 20 54 |ain}.PRO|CEDURE T|
|00001ef0| 65 72 6d 69 6e 61 74 65 | 3b 0d 0d 7b 43 6c 65 61 |erminate|;..{Clea|
|00001f00| 6e 20 75 70 20 74 68 65 | 20 61 70 70 6c 69 63 61 |n up the| applica|
|00001f10| 74 69 6f 6e 20 61 6e 64 | 20 65 78 69 74 73 2e 20 |tion and| exits. |
|00001f20| 57 65 20 63 6c 6f 73 65 | 20 61 6c 6c 20 6f 66 20 |We close| all of |
|00001f30| 74 68 65 20 77 69 6e 64 | 6f 77 73 20 73 6f 20 74 |the wind|ows so t|
|00001f40| 68 61 74 0d 20 74 68 65 | 79 20 63 61 6e 20 75 70 |hat. the|y can up|
|00001f50| 64 61 74 65 20 74 68 65 | 69 72 20 64 6f 63 75 6d |date the|ir docum|
|00001f60| 65 6e 74 73 2c 20 69 66 | 20 61 6e 79 2e 7d 0d 20 |ents, if| any.}. |
|00001f70| 0d 7b 31 2e 30 31 20 2d | 20 49 66 20 77 65 20 66 |.{1.01 -| If we f|
|00001f80| 69 6e 64 20 6f 75 74 20 | 74 68 61 74 20 61 20 63 |ind out |that a c|
|00001f90| 61 6e 63 65 6c 20 68 61 | 73 20 6f 63 63 75 72 72 |ancel ha|s occurr|
|00001fa0| 65 64 2c 20 77 65 20 77 | 6f 6e 27 74 20 65 78 69 |ed, we w|on't exi|
|00001fb0| 74 20 74 6f 20 74 68 65 | 0d 20 73 68 65 6c 6c 2c |t to the|. shell,|
|00001fc0| 20 62 75 74 20 77 69 6c | 6c 20 72 65 74 75 72 6e | but wil|l return|
|00001fd0| 20 69 6e 73 74 65 61 64 | 2e 7d 0d 20 0d 56 41 52 | instead|.}. .VAR|
|00001fe0| 0d 09 61 57 69 6e 64 6f | 77 09 3a 20 57 69 6e 64 |..aWindo|w.: Wind|
|00001ff0| 6f 77 50 74 72 3b 0d 09 | 63 6c 6f 73 65 64 09 3a |owPtr;..|closed.:|
|00002000| 20 42 4f 4f 4c 45 41 4e | 3b 0d 0d 42 45 47 49 4e | BOOLEAN|;..BEGIN|
|00002010| 0d 09 63 6c 6f 73 65 64 | 20 3a 3d 20 54 52 55 45 |..closed| := TRUE|
|00002020| 3b 0d 09 52 45 50 45 41 | 54 0d 09 09 61 57 69 6e |;..REPEA|T...aWin|
|00002030| 64 6f 77 20 3a 3d 20 46 | 72 6f 6e 74 57 69 6e 64 |dow := F|rontWind|
|00002040| 6f 77 3b 09 09 09 09 09 | 7b 67 65 74 20 74 68 65 |ow;.....|{get the|
|00002050| 20 63 75 72 72 65 6e 74 | 20 66 72 6f 6e 74 20 77 | current| front w|
|00002060| 69 6e 64 6f 77 7d 0d 09 | 09 49 46 20 61 57 69 6e |indow}..|.IF aWin|
|00002070| 64 6f 77 20 3c 3e 20 4e | 49 4c 20 54 48 45 4e 0d |dow <> N|IL THEN.|
|00002080| 09 09 09 63 6c 6f 73 65 | 64 20 3a 3d 20 44 6f 43 |...close|d := DoC|
|00002090| 6c 6f 73 65 57 69 6e 64 | 6f 77 28 61 57 69 6e 64 |loseWind|ow(aWind|
|000020a0| 6f 77 29 3b 09 7b 63 6c | 6f 73 65 20 74 68 69 73 |ow);.{cl|ose this|
|000020b0| 20 77 69 6e 64 6f 77 7d | 0d 09 55 4e 54 49 4c 20 | window}|..UNTIL |
|000020c0| 28 4e 4f 54 20 63 6c 6f | 73 65 64 29 20 7c 20 28 |(NOT clo|sed) | (|
|000020d0| 61 57 69 6e 64 6f 77 20 | 3d 20 4e 49 4c 29 3b 09 |aWindow |= NIL);.|
|000020e0| 09 7b 64 6f 20 61 6c 6c | 20 77 69 6e 64 6f 77 73 |.{do all| windows|
|000020f0| 7d 0d 09 49 46 20 63 6c | 6f 73 65 64 20 54 48 45 |}..IF cl|osed THE|
|00002100| 4e 0d 09 09 45 78 69 74 | 54 6f 53 68 65 6c 6c 3b |N...Exit|ToShell;|
|00002110| 09 09 09 09 09 09 09 7b | 65 78 69 74 20 69 66 20 |.......{|exit if |
|00002120| 6e 6f 20 63 61 6e 63 65 | 6c 6c 61 74 69 6f 6e 7d |no cance|llation}|
|00002130| 0d 45 4e 44 3b 20 7b 54 | 65 72 6d 69 6e 61 74 65 |.END; {T|erminate|
|00002140| 7d 0d 0d 0d 7b 24 53 20 | 4d 61 69 6e 7d 0d 50 52 |}...{$S |Main}.PR|
|00002150| 4f 43 45 44 55 52 45 20 | 53 65 74 4c 69 67 68 74 |OCEDURE |SetLight|
|00002160| 28 77 69 6e 64 6f 77 3a | 20 57 69 6e 64 6f 77 50 |(window:| WindowP|
|00002170| 74 72 3b 20 6e 65 77 53 | 74 6f 70 70 65 64 3a 20 |tr; newS|topped: |
|00002180| 42 4f 4f 4c 45 41 4e 29 | 3b 0d 0d 7b 43 68 61 6e |BOOLEAN)|;..{Chan|
|00002190| 67 65 20 74 68 65 20 73 | 65 74 74 69 6e 67 20 6f |ge the s|etting o|
|000021a0| 66 20 74 68 65 20 6c 69 | 67 68 74 2e 7d 0d 0d 42 |f the li|ght.}..B|
|000021b0| 45 47 49 4e 0d 09 49 46 | 20 6e 65 77 53 74 6f 70 |EGIN..IF| newStop|
|000021c0| 70 65 64 20 3c 3e 20 67 | 53 74 6f 70 70 65 64 20 |ped <> g|Stopped |
|000021d0| 54 48 45 4e 20 42 45 47 | 49 4e 0d 09 09 67 53 74 |THEN BEG|IN...gSt|
|000021e0| 6f 70 70 65 64 20 3a 3d | 20 6e 65 77 53 74 6f 70 |opped :=| newStop|
|000021f0| 70 65 64 3b 0d 09 09 53 | 65 74 50 6f 72 74 28 77 |ped;...S|etPort(w|
|00002200| 69 6e 64 6f 77 29 3b 0d | 09 09 49 6e 76 61 6c 52 |indow);.|..InvalR|
|00002210| 65 63 74 28 77 69 6e 64 | 6f 77 5e 2e 70 6f 72 74 |ect(wind|ow^.port|
|00002220| 52 65 63 74 29 3b 0d 09 | 45 4e 44 3b 0d 45 4e 44 |Rect);..|END;.END|
|00002230| 3b 20 7b 53 65 74 4c 69 | 67 68 74 7d 0d 0d 0d 7b |; {SetLi|ght}...{|
|00002240| 24 53 20 4d 61 69 6e 7d | 0d 50 52 4f 43 45 44 55 |$S Main}|.PROCEDU|
|00002250| 52 45 20 41 64 6a 75 73 | 74 4d 65 6e 75 73 3b 0d |RE Adjus|tMenus;.|
|00002260| 0d 56 41 52 0d 09 77 69 | 6e 64 6f 77 09 09 09 3a |.VAR..wi|ndow...:|
|00002270| 20 57 69 6e 64 6f 77 50 | 74 72 3b 0d 09 6d 65 6e | WindowP|tr;..men|
|00002280| 75 09 09 09 3a 20 4d 65 | 6e 75 48 61 6e 64 6c 65 |u...: Me|nuHandle|
|00002290| 3b 0d 0d 42 45 47 49 4e | 0d 09 77 69 6e 64 6f 77 |;..BEGIN|..window|
|000022a0| 20 3a 3d 20 46 72 6f 6e | 74 57 69 6e 64 6f 77 3b | := Fron|tWindow;|
|000022b0| 0d 0d 09 6d 65 6e 75 20 | 3a 3d 20 47 65 74 4d 48 |...menu |:= GetMH|
|000022c0| 61 6e 64 6c 65 28 6d 46 | 69 6c 65 29 3b 0d 09 49 |andle(mF|ile);..I|
|000022d0| 46 20 49 73 44 41 57 69 | 6e 64 6f 77 28 77 69 6e |F IsDAWi|ndow(win|
|000022e0| 64 6f 77 29 20 54 48 45 | 4e 09 09 09 09 7b 77 65 |dow) THE|N....{we|
|000022f0| 20 63 61 6e 20 61 6c 6c | 6f 77 20 64 65 73 6b 20 | can all|ow desk |
|00002300| 61 63 63 65 73 73 6f 72 | 69 65 73 20 74 6f 20 62 |accessor|ies to b|
|00002310| 65 20 63 6c 6f 73 65 64 | 20 66 72 6f 6d 20 74 68 |e closed| from th|
|00002320| 65 20 6d 65 6e 75 7d 0d | 09 09 45 6e 61 62 6c 65 |e menu}.|..Enable|
|00002330| 49 74 65 6d 28 6d 65 6e | 75 2c 20 69 43 6c 6f 73 |Item(men|u, iClos|
|00002340| 65 29 0d 09 45 4c 53 45 | 0d 09 09 44 69 73 61 62 |e)..ELSE|...Disab|
|00002350| 6c 65 49 74 65 6d 28 6d | 65 6e 75 2c 20 69 43 6c |leItem(m|enu, iCl|
|00002360| 6f 73 65 29 3b 09 09 09 | 7b 62 75 74 20 6e 6f 74 |ose);...|{but not|
|00002370| 20 6f 75 72 20 74 72 61 | 66 66 69 63 20 6c 69 67 | our tra|ffic lig|
|00002380| 68 74 20 77 69 6e 64 6f | 77 7d 0d 0d 09 6d 65 6e |ht windo|w}...men|
|00002390| 75 20 3a 3d 20 47 65 74 | 4d 48 61 6e 64 6c 65 28 |u := Get|MHandle(|
|000023a0| 6d 45 64 69 74 29 3b 0d | 09 49 46 20 49 73 44 41 |mEdit);.|.IF IsDA|
|000023b0| 57 69 6e 64 6f 77 28 77 | 69 6e 64 6f 77 29 20 54 |Window(w|indow) T|
|000023c0| 48 45 4e 20 42 45 47 49 | 4e 09 09 7b 61 20 64 65 |HEN BEGI|N..{a de|
|000023d0| 73 6b 20 61 63 63 65 73 | 73 6f 72 79 20 6d 69 67 |sk acces|sory mig|
|000023e0| 68 74 20 6e 65 65 64 20 | 74 68 65 20 65 64 69 74 |ht need |the edit|
|000023f0| 20 6d 65 6e 75 7d 0d 09 | 09 45 6e 61 62 6c 65 49 | menu}..|.EnableI|
|00002400| 74 65 6d 28 6d 65 6e 75 | 2c 20 69 55 6e 64 6f 29 |tem(menu|, iUndo)|
|00002410| 3b 0d 09 09 45 6e 61 62 | 6c 65 49 74 65 6d 28 6d |;...Enab|leItem(m|
|00002420| 65 6e 75 2c 20 69 43 75 | 74 29 3b 0d 09 09 45 6e |enu, iCu|t);...En|
|00002430| 61 62 6c 65 49 74 65 6d | 28 6d 65 6e 75 2c 20 69 |ableItem|(menu, i|
|00002440| 43 6f 70 79 29 3b 0d 09 | 09 45 6e 61 62 6c 65 49 |Copy);..|.EnableI|
|00002450| 74 65 6d 28 6d 65 6e 75 | 2c 20 69 50 61 73 74 65 |tem(menu|, iPaste|
|00002460| 29 3b 0d 09 09 45 6e 61 | 62 6c 65 49 74 65 6d 28 |);...Ena|bleItem(|
|00002470| 6d 65 6e 75 2c 20 69 43 | 6c 65 61 72 29 3b 0d 09 |menu, iC|lear);..|
|00002480| 45 4e 44 20 45 4c 53 45 | 20 42 45 47 49 4e 09 09 |END ELSE| BEGIN..|
|00002490| 09 09 09 09 09 7b 62 75 | 74 20 77 65 20 6b 6e 6f |.....{bu|t we kno|
|000024a0| 77 20 77 65 20 64 6f 20 | 6e 6f 74 7d 0d 09 09 44 |w we do |not}...D|
|000024b0| 69 73 61 62 6c 65 49 74 | 65 6d 28 6d 65 6e 75 2c |isableIt|em(menu,|
|000024c0| 20 69 55 6e 64 6f 29 3b | 0d 09 09 44 69 73 61 62 | iUndo);|...Disab|
|000024d0| 6c 65 49 74 65 6d 28 6d | 65 6e 75 2c 20 69 43 75 |leItem(m|enu, iCu|
|000024e0| 74 29 3b 0d 09 09 44 69 | 73 61 62 6c 65 49 74 65 |t);...Di|sableIte|
|000024f0| 6d 28 6d 65 6e 75 2c 20 | 69 43 6f 70 79 29 3b 0d |m(menu, |iCopy);.|
|00002500| 09 09 44 69 73 61 62 6c | 65 49 74 65 6d 28 6d 65 |..Disabl|eItem(me|
|00002510| 6e 75 2c 20 69 43 6c 65 | 61 72 29 3b 0d 09 09 44 |nu, iCle|ar);...D|
|00002520| 69 73 61 62 6c 65 49 74 | 65 6d 28 6d 65 6e 75 2c |isableIt|em(menu,|
|00002530| 20 69 50 61 73 74 65 29 | 3b 0d 09 45 4e 44 3b 0d | iPaste)|;..END;.|
|00002540| 0d 09 6d 65 6e 75 20 3a | 3d 20 47 65 74 4d 48 61 |..menu :|= GetMHa|
|00002550| 6e 64 6c 65 28 6d 4c 69 | 67 68 74 29 3b 0d 09 49 |ndle(mLi|ght);..I|
|00002560| 46 20 49 73 41 70 70 57 | 69 6e 64 6f 77 28 77 69 |F IsAppW|indow(wi|
|00002570| 6e 64 6f 77 29 20 54 48 | 45 4e 20 42 45 47 49 4e |ndow) TH|EN BEGIN|
|00002580| 09 09 7b 77 65 20 6b 6e | 6f 77 20 74 68 61 74 20 |..{we kn|ow that |
|00002590| 69 74 20 6d 75 73 74 20 | 62 65 20 74 68 65 20 74 |it must |be the t|
|000025a0| 72 61 66 66 69 63 20 6c | 69 67 68 74 7d 0d 09 09 |raffic l|ight}...|
|000025b0| 45 6e 61 62 6c 65 49 74 | 65 6d 28 6d 65 6e 75 2c |EnableIt|em(menu,|
|000025c0| 20 69 53 74 6f 70 29 3b | 0d 09 09 45 6e 61 62 6c | iStop);|...Enabl|
|000025d0| 65 49 74 65 6d 28 6d 65 | 6e 75 2c 20 69 47 6f 29 |eItem(me|nu, iGo)|
|000025e0| 3b 0d 09 45 4e 44 20 45 | 4c 53 45 20 42 45 47 49 |;..END E|LSE BEGI|
|000025f0| 4e 0d 09 09 44 69 73 61 | 62 6c 65 49 74 65 6d 28 |N...Disa|bleItem(|
|00002600| 6d 65 6e 75 2c 20 69 53 | 74 6f 70 29 3b 0d 09 09 |menu, iS|top);...|
|00002610| 44 69 73 61 62 6c 65 49 | 74 65 6d 28 6d 65 6e 75 |DisableI|tem(menu|
|00002620| 2c 20 69 47 6f 29 3b 0d | 09 45 4e 44 3b 0d 09 43 |, iGo);.|.END;..C|
|00002630| 68 65 63 6b 49 74 65 6d | 28 6d 65 6e 75 2c 20 69 |heckItem|(menu, i|
|00002640| 53 74 6f 70 2c 20 67 53 | 74 6f 70 70 65 64 29 3b |Stop, gS|topped);|
|00002650| 09 09 7b 77 65 20 63 61 | 6e 20 61 6c 73 6f 20 64 |..{we ca|n also d|
|00002660| 65 74 65 72 6d 69 6e 65 | 20 63 68 65 63 6b 2f 75 |etermine| check/u|
|00002670| 6e 63 68 65 63 6b 20 73 | 74 61 74 65 2c 20 74 6f |ncheck s|tate, to|
|00002680| 6f 7d 0d 09 43 68 65 63 | 6b 49 74 65 6d 28 6d 65 |o}..Chec|kItem(me|
|00002690| 6e 75 2c 20 69 47 6f 2c | 20 4e 4f 54 20 67 53 74 |nu, iGo,| NOT gSt|
|000026a0| 6f 70 70 65 64 29 3b 0d | 45 4e 44 3b 20 7b 41 64 |opped);.|END; {Ad|
|000026b0| 6a 75 73 74 4d 65 6e 75 | 73 7d 0d 0d 0d 7b 24 53 |justMenu|s}...{$S|
|000026c0| 20 4d 61 69 6e 7d 0d 50 | 52 4f 43 45 44 55 52 45 | Main}.P|ROCEDURE|
|000026d0| 20 44 6f 4d 65 6e 75 43 | 6f 6d 6d 61 6e 64 28 6d | DoMenuC|ommand(m|
|000026e0| 65 6e 75 52 65 73 75 6c | 74 3a 20 4c 4f 4e 47 49 |enuResul|t: LONGI|
|000026f0| 4e 54 29 3b 0d 0d 56 41 | 52 0d 09 6d 65 6e 75 49 |NT);..VA|R..menuI|
|00002700| 44 09 09 09 3a 20 49 4e | 54 45 47 45 52 3b 09 09 |D...: IN|TEGER;..|
|00002710| 7b 74 68 65 20 72 65 73 | 6f 75 72 63 65 20 49 44 |{the res|ource ID|
|00002720| 20 6f 66 20 74 68 65 20 | 73 65 6c 65 63 74 65 64 | of the |selected|
|00002730| 20 6d 65 6e 75 7d 0d 09 | 6d 65 6e 75 49 74 65 6d | menu}..|menuItem|
|00002740| 09 09 3a 20 49 4e 54 45 | 47 45 52 3b 09 09 7b 74 |..: INTE|GER;..{t|
|00002750| 68 65 20 69 74 65 6d 20 | 6e 75 6d 62 65 72 20 6f |he item |number o|
|00002760| 66 20 74 68 65 20 73 65 | 6c 65 63 74 65 64 20 6d |f the se|lected m|
|00002770| 65 6e 75 7d 0d 09 69 74 | 65 6d 48 69 74 09 09 09 |enu}..it|emHit...|
|00002780| 3a 20 49 4e 54 45 47 45 | 52 3b 0d 09 64 61 4e 61 |: INTEGE|R;..daNa|
|00002790| 6d 65 09 09 09 3a 20 53 | 74 72 32 35 35 3b 0d 09 |me...: S|tr255;..|
|000027a0| 64 61 52 65 66 4e 75 6d | 09 09 3a 20 49 4e 54 45 |daRefNum|..: INTE|
|000027b0| 47 45 52 3b 0d 09 68 61 | 6e 64 6c 65 64 42 79 44 |GER;..ha|ndledByD|
|000027c0| 41 09 09 3a 20 42 4f 4f | 4c 45 41 4e 3b 0d 09 69 |A..: BOO|LEAN;..i|
|000027d0| 67 6e 6f 72 65 09 09 09 | 3a 20 42 4f 4f 4c 45 41 |gnore...|: BOOLEA|
|000027e0| 4e 3b 0d 0d 42 45 47 49 | 4e 0d 09 6d 65 6e 75 49 |N;..BEGI|N..menuI|
|000027f0| 44 20 3a 3d 20 48 69 57 | 72 64 28 6d 65 6e 75 52 |D := HiW|rd(menuR|
|00002800| 65 73 75 6c 74 29 3b 09 | 7b 75 73 65 20 62 75 69 |esult);.|{use bui|
|00002810| 6c 74 2d 69 6e 73 20 28 | 66 6f 72 20 65 66 66 69 |lt-ins (|for effi|
|00002820| 63 69 65 6e 63 79 29 2e | 2e 2e 7d 0d 09 6d 65 6e |ciency).|..}..men|
|00002830| 75 49 74 65 6d 20 3a 3d | 20 4c 6f 57 72 64 28 6d |uItem :=| LoWrd(m|
|00002840| 65 6e 75 52 65 73 75 6c | 74 29 3b 09 7b 74 6f 20 |enuResul|t);.{to |
|00002850| 67 65 74 20 6d 65 6e 75 | 20 69 74 65 6d 20 6e 75 |get menu| item nu|
|00002860| 6d 62 65 72 20 61 6e 64 | 20 6d 65 6e 75 20 6e 75 |mber and| menu nu|
|00002870| 6d 62 65 72 7d 0d 09 43 | 41 53 45 20 6d 65 6e 75 |mber}..C|ASE menu|
|00002880| 49 44 20 4f 46 0d 09 09 | 6d 41 70 70 6c 65 3a 0d |ID OF...|mApple:.|
|00002890| 09 09 09 43 41 53 45 20 | 6d 65 6e 75 49 74 65 6d |...CASE |menuItem|
|000028a0| 20 4f 46 0d 09 09 09 09 | 69 41 62 6f 75 74 3a 09 | OF.....|iAbout:.|
|000028b0| 09 09 09 7b 62 72 69 6e | 67 20 75 70 20 61 6c 65 |...{brin|g up ale|
|000028c0| 72 74 20 66 6f 72 20 41 | 62 6f 75 74 7d 0d 09 09 |rt for A|bout}...|
|000028d0| 09 09 09 69 74 65 6d 48 | 69 74 20 3a 3d 20 41 6c |...itemH|it := Al|
|000028e0| 65 72 74 28 72 41 62 6f | 75 74 41 6c 65 72 74 2c |ert(rAbo|utAlert,|
|000028f0| 20 4e 49 4c 29 3b 0d 09 | 09 09 09 4f 54 48 45 52 | NIL);..|...OTHER|
|00002900| 57 49 53 45 20 42 45 47 | 49 4e 09 09 7b 61 6c 6c |WISE BEG|IN..{all|
|00002910| 20 6e 6f 6e 2d 41 62 6f | 75 74 20 69 74 65 6d 73 | non-Abo|ut items|
|00002920| 20 69 6e 20 74 68 69 73 | 20 6d 65 6e 75 20 61 72 | in this| menu ar|
|00002930| 65 20 44 41 73 7d 0d 09 | 09 09 09 09 47 65 74 49 |e DAs}..|....GetI|
|00002940| 74 65 6d 28 47 65 74 4d | 48 61 6e 64 6c 65 28 6d |tem(GetM|Handle(m|
|00002950| 41 70 70 6c 65 29 2c 20 | 6d 65 6e 75 49 74 65 6d |Apple), |menuItem|
|00002960| 2c 20 64 61 4e 61 6d 65 | 29 3b 0d 09 09 09 09 09 |, daName|);......|
|00002970| 64 61 52 65 66 4e 75 6d | 20 3a 3d 20 4f 70 65 6e |daRefNum| := Open|
|00002980| 44 65 73 6b 41 63 63 28 | 64 61 4e 61 6d 65 29 3b |DeskAcc(|daName);|
|00002990| 0d 09 09 09 09 45 4e 44 | 3b 0d 09 09 09 45 4e 44 |.....END|;....END|
|000029a0| 3b 0d 09 09 6d 46 69 6c | 65 3a 0d 09 09 09 43 41 |;...mFil|e:....CA|
|000029b0| 53 45 20 6d 65 6e 75 49 | 74 65 6d 20 4f 46 0d 09 |SE menuI|tem OF..|
|000029c0| 09 09 09 69 43 6c 6f 73 | 65 3a 0d 09 09 09 09 09 |...iClos|e:......|
|000029d0| 69 67 6e 6f 72 65 20 3a | 3d 20 44 6f 43 6c 6f 73 |ignore :|= DoClos|
|000029e0| 65 57 69 6e 64 6f 77 28 | 46 72 6f 6e 74 57 69 6e |eWindow(|FrontWin|
|000029f0| 64 6f 77 29 3b 20 7b 77 | 65 20 64 6f 6e 27 74 20 |dow); {w|e don't |
|00002a00| 63 61 72 65 20 69 66 20 | 63 61 6e 63 65 6c 6c 65 |care if |cancelle|
|00002a10| 64 7d 0d 09 09 09 09 69 | 51 75 69 74 3a 0d 09 09 |d}.....i|Quit:...|
|00002a20| 09 09 09 54 65 72 6d 69 | 6e 61 74 65 3b 0d 09 09 |...Termi|nate;...|
|00002a30| 09 45 4e 44 3b 0d 09 09 | 6d 45 64 69 74 3a 09 09 |.END;...|mEdit:..|
|00002a40| 09 09 09 09 7b 63 61 6c | 6c 20 53 79 73 74 65 6d |....{cal|l System|
|00002a50| 45 64 69 74 20 66 6f 72 | 20 44 41 20 65 64 69 74 |Edit for| DA edit|
|00002a60| 69 6e 67 20 26 20 4d 75 | 6c 74 69 46 69 6e 64 65 |ing & Mu|ltiFinde|
|00002a70| 72 7d 0d 09 09 09 68 61 | 6e 64 6c 65 64 42 79 44 |r}....ha|ndledByD|
|00002a80| 41 20 3a 3d 20 53 79 73 | 74 65 6d 45 64 69 74 28 |A := Sys|temEdit(|
|00002a90| 6d 65 6e 75 49 74 65 6d | 2d 31 29 3b 09 7b 73 69 |menuItem|-1);.{si|
|00002aa0| 6e 63 65 20 77 65 20 64 | 6f 6e 27 74 20 64 6f 20 |nce we d|on't do |
|00002ab0| 61 6e 79 20 65 64 69 74 | 69 6e 67 7d 0d 09 09 6d |any edit|ing}...m|
|00002ac0| 4c 69 67 68 74 3a 0d 09 | 09 09 43 41 53 45 20 6d |Light:..|..CASE m|
|00002ad0| 65 6e 75 49 74 65 6d 20 | 4f 46 0d 09 09 09 09 69 |enuItem |OF.....i|
|00002ae0| 53 74 6f 70 3a 0d 09 09 | 09 09 09 53 65 74 4c 69 |Stop:...|...SetLi|
|00002af0| 67 68 74 28 46 72 6f 6e | 74 57 69 6e 64 6f 77 2c |ght(Fron|tWindow,|
|00002b00| 20 54 52 55 45 29 3b 0d | 09 09 09 09 69 47 6f 3a | TRUE);.|....iGo:|
|00002b10| 0d 09 09 09 09 09 53 65 | 74 4c 69 67 68 74 28 46 |......Se|tLight(F|
|00002b20| 72 6f 6e 74 57 69 6e 64 | 6f 77 2c 20 46 41 4c 53 |rontWind|ow, FALS|
|00002b30| 45 29 3b 0d 09 09 09 45 | 4e 44 3b 0d 09 45 4e 44 |E);....E|ND;..END|
|00002b40| 3b 0d 09 48 69 6c 69 74 | 65 4d 65 6e 75 28 30 29 |;..Hilit|eMenu(0)|
|00002b50| 3b 09 09 09 09 09 7b 75 | 6e 68 69 67 68 6c 69 67 |;.....{u|nhighlig|
|00002b60| 68 74 20 77 68 61 74 20 | 4d 65 6e 75 53 65 6c 65 |ht what |MenuSele|
|00002b70| 63 74 20 28 6f 72 20 4d | 65 6e 75 4b 65 79 29 20 |ct (or M|enuKey) |
|00002b80| 68 69 6c 69 74 65 64 7d | 0d 45 4e 44 3b 20 7b 44 |hilited}|.END; {D|
|00002b90| 6f 4d 65 6e 75 43 6f 6d | 6d 61 6e 64 7d 0d 0d 0d |oMenuCom|mand}...|
|00002ba0| 7b 24 53 20 4d 61 69 6e | 7d 0d 50 52 4f 43 45 44 |{$S Main|}.PROCED|
|00002bb0| 55 52 45 20 44 72 61 77 | 57 69 6e 64 6f 77 28 77 |URE Draw|Window(w|
|00002bc0| 69 6e 64 6f 77 3a 20 57 | 69 6e 64 6f 77 50 74 72 |indow: W|indowPtr|
|00002bd0| 29 3b 0d 0d 42 45 47 49 | 4e 0d 09 53 65 74 50 6f |);..BEGI|N..SetPo|
|00002be0| 72 74 28 77 69 6e 64 6f | 77 29 3b 0d 0d 09 45 72 |rt(windo|w);...Er|
|00002bf0| 61 73 65 52 65 63 74 28 | 77 69 6e 64 6f 77 5e 2e |aseRect(|window^.|
|00002c00| 70 6f 72 74 52 65 63 74 | 29 3b 09 7b 63 6c 65 61 |portRect|);.{clea|
|00002c10| 72 20 6f 75 74 20 61 6e | 79 20 67 61 72 62 61 67 |r out an|y garbag|
|00002c20| 65 20 74 68 61 74 20 6d | 69 67 68 74 20 62 65 20 |e that m|ight be |
|00002c30| 6c 65 66 74 20 62 65 68 | 69 6e 64 7d 0d 09 49 46 |left beh|ind}..IF|
|00002c40| 20 67 53 74 6f 70 70 65 | 64 20 54 48 45 4e 09 09 | gStoppe|d THEN..|
|00002c50| 09 09 7b 64 72 61 77 20 | 61 20 72 65 64 20 28 6f |..{draw |a red (o|
|00002c60| 72 20 77 68 69 74 65 29 | 20 73 74 6f 70 20 6c 69 |r white)| stop li|
|00002c70| 67 68 74 7d 0d 09 09 46 | 6f 72 65 43 6f 6c 6f 72 |ght}...F|oreColor|
|00002c80| 28 72 65 64 43 6f 6c 6f | 72 29 0d 09 45 4c 53 45 |(redColo|r)..ELSE|
|00002c90| 0d 09 09 46 6f 72 65 43 | 6f 6c 6f 72 28 77 68 69 |...ForeC|olor(whi|
|00002ca0| 74 65 43 6f 6c 6f 72 29 | 3b 0d 09 50 61 69 6e 74 |teColor)|;..Paint|
|00002cb0| 4f 76 61 6c 28 67 53 74 | 6f 70 52 65 63 74 29 3b |Oval(gSt|opRect);|
|00002cc0| 0d 09 46 6f 72 65 43 6f | 6c 6f 72 28 62 6c 61 63 |..ForeCo|lor(blac|
|00002cd0| 6b 43 6f 6c 6f 72 29 3b | 0d 09 46 72 61 6d 65 4f |kColor);|..FrameO|
|00002ce0| 76 61 6c 28 67 53 74 6f | 70 52 65 63 74 29 3b 0d |val(gSto|pRect);.|
|00002cf0| 09 49 46 20 4e 4f 54 20 | 67 53 74 6f 70 70 65 64 |.IF NOT |gStopped|
|00002d00| 20 54 48 45 4e 09 09 09 | 7b 64 72 61 77 20 61 20 | THEN...|{draw a |
|00002d10| 67 72 65 65 6e 20 28 6f | 72 20 77 68 69 74 65 29 |green (o|r white)|
|00002d20| 20 67 6f 20 6c 69 67 68 | 74 7d 0d 09 09 46 6f 72 | go ligh|t}...For|
|00002d30| 65 43 6f 6c 6f 72 28 67 | 72 65 65 6e 43 6f 6c 6f |eColor(g|reenColo|
|00002d40| 72 29 0d 09 45 4c 53 45 | 0d 09 09 46 6f 72 65 43 |r)..ELSE|...ForeC|
|00002d50| 6f 6c 6f 72 28 77 68 69 | 74 65 43 6f 6c 6f 72 29 |olor(whi|teColor)|
|00002d60| 3b 0d 09 50 61 69 6e 74 | 4f 76 61 6c 28 67 47 6f |;..Paint|Oval(gGo|
|00002d70| 52 65 63 74 29 3b 0d 09 | 46 6f 72 65 43 6f 6c 6f |Rect);..|ForeColo|
|00002d80| 72 28 62 6c 61 63 6b 43 | 6f 6c 6f 72 29 3b 0d 09 |r(blackC|olor);..|
|00002d90| 46 72 61 6d 65 4f 76 61 | 6c 28 67 47 6f 52 65 63 |FrameOva|l(gGoRec|
|00002da0| 74 29 3b 0d 45 4e 44 3b | 20 7b 44 72 61 77 57 69 |t);.END;| {DrawWi|
|00002db0| 6e 64 6f 77 7d 0d 0d 0d | 7b 24 53 20 4d 61 69 6e |ndow}...|{$S Main|
|00002dc0| 7d 0d 50 52 4f 43 45 44 | 55 52 45 20 44 6f 43 6f |}.PROCED|URE DoCo|
|00002dd0| 6e 74 65 6e 74 43 6c 69 | 63 6b 28 77 69 6e 64 6f |ntentCli|ck(windo|
|00002de0| 77 3a 20 57 69 6e 64 6f | 77 50 74 72 3b 20 65 76 |w: Windo|wPtr; ev|
|00002df0| 65 6e 74 3a 20 45 76 65 | 6e 74 52 65 63 6f 72 64 |ent: Eve|ntRecord|
|00002e00| 29 3b 0d 0d 42 45 47 49 | 4e 0d 09 53 65 74 4c 69 |);..BEGI|N..SetLi|
|00002e10| 67 68 74 28 77 69 6e 64 | 6f 77 2c 20 4e 4f 54 20 |ght(wind|ow, NOT |
|00002e20| 67 53 74 6f 70 70 65 64 | 29 3b 0d 45 4e 44 3b 20 |gStopped|);.END; |
|00002e30| 7b 44 6f 43 6f 6e 74 65 | 6e 74 43 6c 69 63 6b 7d |{DoConte|ntClick}|
|00002e40| 0d 0d 0d 7b 24 53 20 4d | 61 69 6e 7d 0d 50 52 4f |...{$S M|ain}.PRO|
|00002e50| 43 45 44 55 52 45 20 44 | 6f 55 70 64 61 74 65 28 |CEDURE D|oUpdate(|
|00002e60| 77 69 6e 64 6f 77 3a 20 | 57 69 6e 64 6f 77 50 74 |window: |WindowPt|
|00002e70| 72 29 3b 0d 0d 42 45 47 | 49 4e 0d 09 49 46 20 49 |r);..BEG|IN..IF I|
|00002e80| 73 41 70 70 57 69 6e 64 | 6f 77 28 77 69 6e 64 6f |sAppWind|ow(windo|
|00002e90| 77 29 20 54 48 45 4e 20 | 42 45 47 49 4e 0d 09 09 |w) THEN |BEGIN...|
|00002ea0| 42 65 67 69 6e 55 70 64 | 61 74 65 28 77 69 6e 64 |BeginUpd|ate(wind|
|00002eb0| 6f 77 29 3b 09 09 09 09 | 09 7b 73 65 74 73 20 75 |ow);....|.{sets u|
|00002ec0| 70 20 74 68 65 20 76 69 | 73 52 67 6e 2c 20 63 6c |p the vi|sRgn, cl|
|00002ed0| 65 61 72 73 20 75 70 64 | 61 74 65 52 67 6e 7d 0d |ears upd|ateRgn}.|
|00002ee0| 09 09 49 46 20 4e 4f 54 | 20 45 6d 70 74 79 52 67 |..IF NOT| EmptyRg|
|00002ef0| 6e 28 77 69 6e 64 6f 77 | 5e 2e 76 69 73 52 67 6e |n(window|^.visRgn|
|00002f00| 29 20 54 48 45 4e 09 7b | 64 72 61 77 20 69 66 20 |) THEN.{|draw if |
|00002f10| 75 70 64 61 74 69 6e 67 | 20 6e 65 65 64 73 20 74 |updating| needs t|
|00002f20| 6f 20 62 65 20 64 6f 6e | 65 7d 0d 09 09 09 44 72 |o be don|e}....Dr|
|00002f30| 61 77 57 69 6e 64 6f 77 | 28 77 69 6e 64 6f 77 29 |awWindow|(window)|
|00002f40| 3b 0d 09 09 45 6e 64 55 | 70 64 61 74 65 28 77 69 |;...EndU|pdate(wi|
|00002f50| 6e 64 6f 77 29 3b 09 09 | 09 09 09 09 7b 72 65 73 |ndow);..|....{res|
|00002f60| 74 6f 72 65 73 20 74 68 | 65 20 76 69 73 52 67 6e |tores th|e visRgn|
|00002f70| 7d 0d 09 45 4e 44 3b 0d | 45 4e 44 3b 20 7b 44 6f |}..END;.|END; {Do|
|00002f80| 55 70 64 61 74 65 7d 0d | 0d 0d 7b 24 53 20 4d 61 |Update}.|..{$S Ma|
|00002f90| 69 6e 7d 0d 50 52 4f 43 | 45 44 55 52 45 20 44 6f |in}.PROC|EDURE Do|
|00002fa0| 41 63 74 69 76 61 74 65 | 28 77 69 6e 64 6f 77 3a |Activate|(window:|
|00002fb0| 20 57 69 6e 64 6f 77 50 | 74 72 3b 20 62 65 63 6f | WindowP|tr; beco|
|00002fc0| 6d 69 6e 67 41 63 74 69 | 76 65 3a 20 42 4f 4f 4c |mingActi|ve: BOOL|
|00002fd0| 45 41 4e 29 3b 0d 0d 0d | 42 45 47 49 4e 0d 09 49 |EAN);...|BEGIN..I|
|00002fe0| 46 20 49 73 41 70 70 57 | 69 6e 64 6f 77 28 77 69 |F IsAppW|indow(wi|
|00002ff0| 6e 64 6f 77 29 20 54 48 | 45 4e 0d 09 09 49 46 20 |ndow) TH|EN...IF |
|00003000| 62 65 63 6f 6d 69 6e 67 | 41 63 74 69 76 65 20 54 |becoming|Active T|
|00003010| 48 45 4e 0d 09 09 09 7b | 64 6f 20 77 68 61 74 65 |HEN....{|do whate|
|00003020| 76 65 72 20 79 6f 75 20 | 6e 65 65 64 20 74 6f 20 |ver you |need to |
|00003030| 61 74 20 61 63 74 69 76 | 61 74 69 6f 6e 7d 0d 09 |at activ|ation}..|
|00003040| 09 45 4c 53 45 0d 09 09 | 09 7b 64 6f 20 77 68 61 |.ELSE...|.{do wha|
|00003050| 74 65 76 65 72 20 79 6f | 75 20 6e 65 65 64 20 74 |tever yo|u need t|
|00003060| 6f 20 61 74 20 64 65 61 | 63 74 69 76 61 74 69 6f |o at dea|ctivatio|
|00003070| 6e 7d 3b 0d 45 4e 44 3b | 20 7b 44 6f 41 63 74 69 |n};.END;| {DoActi|
|00003080| 76 61 74 65 7d 0d 0d 0d | 7b 24 53 20 4d 61 69 6e |vate}...|{$S Main|
|00003090| 7d 0d 50 52 4f 43 45 44 | 55 52 45 20 47 65 74 47 |}.PROCED|URE GetG|
|000030a0| 6c 6f 62 61 6c 4d 6f 75 | 73 65 28 56 41 52 20 6d |lobalMou|se(VAR m|
|000030b0| 6f 75 73 65 3a 20 50 6f | 69 6e 74 29 3b 0d 0d 0d |ouse: Po|int);...|
|000030c0| 56 41 52 0d 09 65 76 65 | 6e 74 09 3a 20 45 76 65 |VAR..eve|nt.: Eve|
|000030d0| 6e 74 52 65 63 6f 72 64 | 3b 0d 09 0d 42 45 47 49 |ntRecord|;...BEGI|
|000030e0| 4e 0d 09 49 46 20 4f 53 | 45 76 65 6e 74 41 76 61 |N..IF OS|EventAva|
|000030f0| 69 6c 28 6b 4e 6f 45 76 | 65 6e 74 73 2c 20 65 76 |il(kNoEv|ents, ev|
|00003100| 65 6e 74 29 20 54 48 45 | 4e 3b 09 7b 77 65 20 61 |ent) THE|N;.{we a|
|00003110| 72 65 6e 27 74 20 69 6e | 74 65 72 65 73 74 65 64 |ren't in|terested|
|00003120| 20 69 6e 20 61 6e 79 20 | 65 76 65 6e 74 73 7d 0d | in any |events}.|
|00003130| 09 6d 6f 75 73 65 20 3a | 3d 20 65 76 65 6e 74 2e |.mouse :|= event.|
|00003140| 77 68 65 72 65 3b 09 09 | 09 09 09 7b 6a 75 73 74 |where;..|...{just|
|00003150| 20 74 68 65 20 6d 6f 75 | 73 65 20 70 6f 73 69 74 | the mou|se posit|
|00003160| 69 6f 6e 7d 0d 45 4e 44 | 3b 0d 0d 0d 7b 24 53 20 |ion}.END|;...{$S |
|00003170| 4d 61 69 6e 7d 0d 50 52 | 4f 43 45 44 55 52 45 20 |Main}.PR|OCEDURE |
|00003180| 41 64 6a 75 73 74 43 75 | 72 73 6f 72 28 6d 6f 75 |AdjustCu|rsor(mou|
|00003190| 73 65 3a 20 50 6f 69 6e | 74 3b 20 72 65 67 69 6f |se: Poin|t; regio|
|000031a0| 6e 3a 20 52 67 6e 48 61 | 6e 64 6c 65 29 3b 0d 0d |n: RgnHa|ndle);..|
|000031b0| 56 41 52 0d 09 77 69 6e | 64 6f 77 09 09 09 09 3a |VAR..win|dow....:|
|000031c0| 20 57 69 6e 64 6f 77 50 | 74 72 3b 0d 09 61 72 72 | WindowP|tr;..arr|
|000031d0| 6f 77 52 67 6e 09 09 09 | 3a 20 52 67 6e 48 61 6e |owRgn...|: RgnHan|
|000031e0| 64 6c 65 3b 0d 09 70 6c | 75 73 52 67 6e 09 09 09 |dle;..pl|usRgn...|
|000031f0| 09 3a 20 52 67 6e 48 61 | 6e 64 6c 65 3b 0d 09 67 |.: RgnHa|ndle;..g|
|00003200| 6c 6f 62 61 6c 50 6f 72 | 74 52 65 63 74 09 09 3a |lobalPor|tRect..:|
|00003210| 20 52 65 63 74 3b 0d 09 | 0d 0d 42 45 47 49 4e 0d | Rect;..|..BEGIN.|
|00003220| 09 77 69 6e 64 6f 77 20 | 3a 3d 20 46 72 6f 6e 74 |.window |:= Front|
|00003230| 57 69 6e 64 6f 77 3b 09 | 7b 77 65 20 6f 6e 6c 79 |Window;.|{we only|
|00003240| 20 61 64 6a 75 73 74 20 | 74 68 65 20 63 75 72 73 | adjust |the curs|
|00003250| 6f 72 20 77 68 65 6e 20 | 77 65 20 61 72 65 20 69 |or when |we are i|
|00003260| 6e 20 66 72 6f 6e 74 7d | 0d 09 49 46 20 28 4e 4f |n front}|..IF (NO|
|00003270| 54 20 67 49 6e 42 61 63 | 6b 67 72 6f 75 6e 64 29 |T gInBac|kground)|
|00003280| 20 41 4e 44 20 28 4e 4f | 54 20 49 73 44 41 57 69 | AND (NO|T IsDAWi|
|00003290| 6e 64 6f 77 28 77 69 6e | 64 6f 77 29 29 20 54 48 |ndow(win|dow)) TH|
|000032a0| 45 4e 20 42 45 47 49 4e | 0d 09 09 7b 63 61 6c 63 |EN BEGIN|...{calc|
|000032b0| 75 6c 61 74 65 20 72 65 | 67 69 6f 6e 73 20 66 6f |ulate re|gions fo|
|000032c0| 72 20 64 69 66 66 65 72 | 65 6e 74 20 63 75 72 73 |r differ|ent curs|
|000032d0| 6f 72 20 73 68 61 70 65 | 73 7d 0d 09 09 61 72 72 |or shape|s}...arr|
|000032e0| 6f 77 52 67 6e 20 3a 3d | 20 4e 65 77 52 67 6e 3b |owRgn :=| NewRgn;|
|000032f0| 0d 09 09 70 6c 75 73 52 | 67 6e 20 3a 3d 20 4e 65 |...plusR|gn := Ne|
|00003300| 77 52 67 6e 3b 0d 0d 09 | 09 7b 73 74 61 72 74 20 |wRgn;...|.{start |
|00003310| 77 69 74 68 20 61 20 62 | 69 67 2c 20 62 69 67 20 |with a b|ig, big |
|00003320| 72 65 63 74 61 6e 67 75 | 6c 61 72 20 72 65 67 69 |rectangu|lar regi|
|00003330| 6f 6e 7d 0d 09 09 7b 31 | 2e 30 31 20 2d 20 63 68 |on}...{1|.01 - ch|
|00003340| 61 6e 67 65 64 20 74 6f | 20 6b 45 78 74 72 65 6d |anged to| kExtrem|
|00003350| 65 4e 65 67 20 61 6e 64 | 20 6b 45 78 74 72 65 6d |eNeg and| kExtrem|
|00003360| 65 50 6f 73 20 66 6f 72 | 20 63 6f 6e 73 69 73 74 |ePos for| consist|
|00003370| 65 6e 63 79 7d 0d 09 09 | 53 65 74 52 65 63 74 52 |ency}...|SetRectR|
|00003380| 67 6e 28 61 72 72 6f 77 | 52 67 6e 2c 20 6b 45 78 |gn(arrow|Rgn, kEx|
|00003390| 74 72 65 6d 65 4e 65 67 | 2c 20 6b 45 78 74 72 65 |tremeNeg|, kExtre|
|000033a0| 6d 65 4e 65 67 2c 0d 09 | 09 09 09 09 09 09 6b 45 |meNeg,..|......kE|
|000033b0| 78 74 72 65 6d 65 50 6f | 73 2c 20 6b 45 78 74 72 |xtremePo|s, kExtr|
|000033c0| 65 6d 65 50 6f 73 29 3b | 0d 0d 09 09 7b 63 61 6c |emePos);|....{cal|
|000033d0| 63 75 6c 61 74 65 20 70 | 6c 75 73 52 67 6e 7d 0d |culate p|lusRgn}.|
|000033e0| 09 09 49 46 20 49 73 41 | 70 70 57 69 6e 64 6f 77 |..IF IsA|ppWindow|
|000033f0| 28 77 69 6e 64 6f 77 29 | 20 54 48 45 4e 20 42 45 |(window)| THEN BE|
|00003400| 47 49 4e 0d 09 09 09 53 | 65 74 50 6f 72 74 28 77 |GIN....S|etPort(w|
|00003410| 69 6e 64 6f 77 29 3b 09 | 09 09 7b 6d 61 6b 65 20 |indow);.|..{make |
|00003420| 61 20 67 6c 6f 62 61 6c | 20 76 65 72 73 69 6f 6e |a global| version|
|00003430| 20 6f 66 20 74 68 65 20 | 70 6f 72 74 52 65 63 74 | of the |portRect|
|00003440| 7d 0d 09 09 09 53 65 74 | 4f 72 69 67 69 6e 28 2d |}....Set|Origin(-|
|00003450| 77 69 6e 64 6f 77 5e 2e | 70 6f 72 74 42 69 74 73 |window^.|portBits|
|00003460| 2e 62 6f 75 6e 64 73 2e | 6c 65 66 74 2c 20 2d 77 |.bounds.|left, -w|
|00003470| 69 6e 64 6f 77 5e 2e 70 | 6f 72 74 42 69 74 73 2e |indow^.p|ortBits.|
|00003480| 62 6f 75 6e 64 73 2e 74 | 6f 70 29 3b 0d 09 09 09 |bounds.t|op);....|
|00003490| 67 6c 6f 62 61 6c 50 6f | 72 74 52 65 63 74 20 3a |globalPo|rtRect :|
|000034a0| 3d 20 77 69 6e 64 6f 77 | 5e 2e 70 6f 72 74 52 65 |= window|^.portRe|
|000034b0| 63 74 3b 0d 09 09 09 52 | 65 63 74 52 67 6e 28 70 |ct;....R|ectRgn(p|
|000034c0| 6c 75 73 52 67 6e 2c 20 | 67 6c 6f 62 61 6c 50 6f |lusRgn, |globalPo|
|000034d0| 72 74 52 65 63 74 29 3b | 0d 09 09 09 53 65 63 74 |rtRect);|....Sect|
|000034e0| 52 67 6e 28 70 6c 75 73 | 52 67 6e 2c 20 77 69 6e |Rgn(plus|Rgn, win|
|000034f0| 64 6f 77 5e 2e 76 69 73 | 52 67 6e 2c 20 70 6c 75 |dow^.vis|Rgn, plu|
|00003500| 73 52 67 6e 29 3b 0d 09 | 09 09 53 65 74 4f 72 69 |sRgn);..|..SetOri|
|00003510| 67 69 6e 28 30 2c 20 30 | 29 3b 0d 09 09 45 4e 44 |gin(0, 0|);...END|
|00003520| 3b 0d 0d 09 09 7b 73 75 | 62 74 72 61 63 74 20 6f |;....{su|btract o|
|00003530| 74 68 65 72 20 72 65 67 | 69 6f 6e 73 20 66 72 6f |ther reg|ions fro|
|00003540| 6d 20 61 72 72 6f 77 52 | 67 6e 7d 0d 09 09 44 69 |m arrowR|gn}...Di|
|00003550| 66 66 52 67 6e 28 61 72 | 72 6f 77 52 67 6e 2c 20 |ffRgn(ar|rowRgn, |
|00003560| 70 6c 75 73 52 67 6e 2c | 20 61 72 72 6f 77 52 67 |plusRgn,| arrowRg|
|00003570| 6e 29 3b 0d 0d 09 09 7b | 63 68 61 6e 67 65 20 74 |n);....{|change t|
|00003580| 68 65 20 63 75 72 73 6f | 72 20 61 6e 64 20 74 68 |he curso|r and th|
|00003590| 65 20 72 65 67 69 6f 6e | 20 70 61 72 61 6d 65 74 |e region| paramet|
|000035a0| 65 72 7d 0d 09 09 49 46 | 20 50 74 49 6e 52 67 6e |er}...IF| PtInRgn|
|000035b0| 28 6d 6f 75 73 65 2c 20 | 70 6c 75 73 52 67 6e 29 |(mouse, |plusRgn)|
|000035c0| 20 54 48 45 4e 20 42 45 | 47 49 4e 0d 09 09 09 53 | THEN BE|GIN....S|
|000035d0| 65 74 43 75 72 73 6f 72 | 28 47 65 74 43 75 72 73 |etCursor|(GetCurs|
|000035e0| 6f 72 28 70 6c 75 73 43 | 75 72 73 6f 72 29 5e 5e |or(plusC|ursor)^^|
|000035f0| 29 3b 0d 09 09 09 43 6f | 70 79 52 67 6e 28 70 6c |);....Co|pyRgn(pl|
|00003600| 75 73 52 67 6e 2c 20 72 | 65 67 69 6f 6e 29 3b 0d |usRgn, r|egion);.|
|00003610| 09 09 45 4e 44 20 45 4c | 53 45 20 42 45 47 49 4e |..END EL|SE BEGIN|
|00003620| 0d 09 09 09 53 65 74 43 | 75 72 73 6f 72 28 61 72 |....SetC|ursor(ar|
|00003630| 72 6f 77 29 3b 0d 09 09 | 09 43 6f 70 79 52 67 6e |row);...|.CopyRgn|
|00003640| 28 61 72 72 6f 77 52 67 | 6e 2c 20 72 65 67 69 6f |(arrowRg|n, regio|
|00003650| 6e 29 3b 0d 09 09 45 4e | 44 3b 0d 0d 09 09 7b 67 |n);...EN|D;....{g|
|00003660| 65 74 20 72 69 64 20 6f | 66 20 6f 75 72 20 6c 6f |et rid o|f our lo|
|00003670| 63 61 6c 20 72 65 67 69 | 6f 6e 73 7d 0d 09 09 44 |cal regi|ons}...D|
|00003680| 69 73 70 6f 73 65 52 67 | 6e 28 61 72 72 6f 77 52 |isposeRg|n(arrowR|
|00003690| 67 6e 29 3b 0d 09 09 44 | 69 73 70 6f 73 65 52 67 |gn);...D|isposeRg|
|000036a0| 6e 28 70 6c 75 73 52 67 | 6e 29 3b 0d 09 45 4e 44 |n(plusRg|n);..END|
|000036b0| 3b 0d 45 4e 44 3b 20 7b | 41 64 6a 75 73 74 43 75 |;.END; {|AdjustCu|
|000036c0| 72 73 6f 72 7d 0d 0d 0d | 7b 24 53 20 4d 61 69 6e |rsor}...|{$S Main|
|000036d0| 7d 0d 50 52 4f 43 45 44 | 55 52 45 20 44 6f 45 76 |}.PROCED|URE DoEv|
|000036e0| 65 6e 74 28 65 76 65 6e | 74 3a 20 45 76 65 6e 74 |ent(even|t: Event|
|000036f0| 52 65 63 6f 72 64 29 3b | 0d 0d 7b 44 6f 20 74 68 |Record);|..{Do th|
|00003700| 65 20 72 69 67 68 74 20 | 74 68 69 6e 67 20 66 6f |e right |thing fo|
|00003710| 72 20 61 6e 20 65 76 65 | 6e 74 2e 20 44 65 74 65 |r an eve|nt. Dete|
|00003720| 72 6d 69 6e 65 20 77 68 | 61 74 20 6b 69 6e 64 20 |rmine wh|at kind |
|00003730| 6f 66 20 65 76 65 6e 74 | 20 69 74 20 69 73 2c 20 |of event| it is, |
|00003740| 61 6e 64 20 63 61 6c 6c | 0d 20 74 68 65 20 61 70 |and call|. the ap|
|00003750| 70 72 6f 70 72 69 61 74 | 65 20 72 6f 75 74 69 6e |propriat|e routin|
|00003760| 65 73 2e 7d 0d 0d 56 41 | 52 0d 09 70 61 72 74 2c |es.}..VA|R..part,|
|00003770| 20 65 72 72 09 3a 20 49 | 4e 54 45 47 45 52 3b 0d | err.: I|NTEGER;.|
|00003780| 09 77 69 6e 64 6f 77 09 | 09 3a 20 57 69 6e 64 6f |.window.|.: Windo|
|00003790| 77 50 74 72 3b 0d 09 68 | 69 74 09 09 09 3a 20 42 |wPtr;..h|it...: B|
|000037a0| 4f 4f 4c 45 41 4e 3b 0d | 09 6b 65 79 09 09 09 3a |OOLEAN;.|.key...:|
|000037b0| 20 43 48 41 52 3b 0d 09 | 61 50 6f 69 6e 74 09 09 | CHAR;..|aPoint..|
|000037c0| 3a 20 50 6f 69 6e 74 3b | 0d 0d 42 45 47 49 4e 0d |: Point;|..BEGIN.|
|000037d0| 09 43 41 53 45 20 65 76 | 65 6e 74 2e 77 68 61 74 |.CASE ev|ent.what|
|000037e0| 20 4f 46 0d 09 09 6d 6f | 75 73 65 44 6f 77 6e 3a | OF...mo|useDown:|
|000037f0| 20 42 45 47 49 4e 0d 09 | 09 09 70 61 72 74 20 3a | BEGIN..|..part :|
|00003800| 3d 20 46 69 6e 64 57 69 | 6e 64 6f 77 28 65 76 65 |= FindWi|ndow(eve|
|00003810| 6e 74 2e 77 68 65 72 65 | 2c 20 77 69 6e 64 6f 77 |nt.where|, window|
|00003820| 29 3b 0d 09 09 09 43 41 | 53 45 20 70 61 72 74 20 |);....CA|SE part |
|00003830| 4f 46 0d 09 09 09 09 69 | 6e 4d 65 6e 75 42 61 72 |OF.....i|nMenuBar|
|00003840| 3a 20 42 45 47 49 4e 09 | 09 09 7b 70 72 6f 63 65 |: BEGIN.|..{proce|
|00003850| 73 73 20 74 68 65 20 6d | 65 6e 75 20 63 6f 6d 6d |ss the m|enu comm|
|00003860| 61 6e 64 7d 0d 09 09 09 | 09 09 41 64 6a 75 73 74 |and}....|..Adjust|
|00003870| 4d 65 6e 75 73 3b 0d 09 | 09 09 09 09 44 6f 4d 65 |Menus;..|....DoMe|
|00003880| 6e 75 43 6f 6d 6d 61 6e | 64 28 4d 65 6e 75 53 65 |nuComman|d(MenuSe|
|00003890| 6c 65 63 74 28 65 76 65 | 6e 74 2e 77 68 65 72 65 |lect(eve|nt.where|
|000038a0| 29 29 3b 0d 09 09 09 09 | 45 4e 44 3b 0d 09 09 09 |));.....|END;....|
|000038b0| 09 69 6e 53 79 73 57 69 | 6e 64 6f 77 3a 09 09 09 |.inSysWi|ndow:...|
|000038c0| 09 7b 6c 65 74 20 74 68 | 65 20 73 79 73 74 65 6d |.{let th|e system|
|000038d0| 20 68 61 6e 64 6c 65 20 | 74 68 65 20 6d 6f 75 73 | handle |the mous|
|000038e0| 65 44 6f 77 6e 7d 0d 09 | 09 09 09 09 53 79 73 74 |eDown}..|....Syst|
|000038f0| 65 6d 43 6c 69 63 6b 28 | 65 76 65 6e 74 2c 20 77 |emClick(|event, w|
|00003900| 69 6e 64 6f 77 29 3b 0d | 09 09 09 09 69 6e 43 6f |indow);.|....inCo|
|00003910| 6e 74 65 6e 74 3a 0d 09 | 09 09 09 09 49 46 20 77 |ntent:..|....IF w|
|00003920| 69 6e 64 6f 77 20 3c 3e | 20 46 72 6f 6e 74 57 69 |indow <>| FrontWi|
|00003930| 6e 64 6f 77 20 54 48 45 | 4e 20 42 45 47 49 4e 0d |ndow THE|N BEGIN.|
|00003940| 09 09 09 09 09 09 53 65 | 6c 65 63 74 57 69 6e 64 |......Se|lectWind|
|00003950| 6f 77 28 77 69 6e 64 6f | 77 29 3b 0d 09 09 09 09 |ow(windo|w);.....|
|00003960| 09 09 7b 44 6f 45 76 65 | 6e 74 28 65 76 65 6e 74 |..{DoEve|nt(event|
|00003970| 29 3b 7d 09 7b 75 73 65 | 20 74 68 69 73 20 6c 69 |);}.{use| this li|
|00003980| 6e 65 20 66 6f 72 20 22 | 64 6f 20 66 69 72 73 74 |ne for "|do first|
|00003990| 20 63 6c 69 63 6b 22 7d | 0d 09 09 09 09 09 45 4e | click"}|......EN|
|000039a0| 44 20 45 4c 53 45 0d 09 | 09 09 09 09 09 44 6f 43 |D ELSE..|.....DoC|
|000039b0| 6f 6e 74 65 6e 74 43 6c | 69 63 6b 28 77 69 6e 64 |ontentCl|ick(wind|
|000039c0| 6f 77 2c 20 65 76 65 6e | 74 29 3b 0d 09 09 09 09 |ow, even|t);.....|
|000039d0| 69 6e 44 72 61 67 3a 09 | 09 09 09 09 09 7b 70 61 |inDrag:.|.....{pa|
|000039e0| 73 73 20 73 63 72 65 65 | 6e 42 69 74 73 2e 62 6f |ss scree|nBits.bo|
|000039f0| 75 6e 64 73 20 74 6f 20 | 67 65 74 20 61 6c 6c 20 |unds to |get all |
|00003a00| 67 44 65 76 69 63 65 73 | 7d 0d 09 09 09 09 09 44 |gDevices|}......D|
|00003a10| 72 61 67 57 69 6e 64 6f | 77 28 77 69 6e 64 6f 77 |ragWindo|w(window|
|00003a20| 2c 20 65 76 65 6e 74 2e | 77 68 65 72 65 2c 20 73 |, event.|where, s|
|00003a30| 63 72 65 65 6e 42 69 74 | 73 2e 62 6f 75 6e 64 73 |creenBit|s.bounds|
|00003a40| 29 3b 0d 09 09 09 09 69 | 6e 47 72 6f 77 3a 3b 0d |);.....i|nGrow:;.|
|00003a50| 09 09 09 09 69 6e 5a 6f | 6f 6d 49 6e 2c 20 69 6e |....inZo|omIn, in|
|00003a60| 5a 6f 6f 6d 4f 75 74 3a | 3b 0d 09 09 09 45 4e 44 |ZoomOut:|;....END|
|00003a70| 3b 0d 09 09 45 4e 44 3b | 0d 09 09 6b 65 79 44 6f |;...END;|...keyDo|
|00003a80| 77 6e 2c 20 61 75 74 6f | 4b 65 79 3a 20 42 45 47 |wn, auto|Key: BEG|
|00003a90| 49 4e 09 09 09 09 7b 63 | 68 65 63 6b 20 66 6f 72 |IN....{c|heck for|
|00003aa0| 20 6d 65 6e 75 6b 65 79 | 20 65 71 75 69 76 61 6c | menukey| equival|
|00003ab0| 65 6e 74 73 7d 0d 09 09 | 09 6b 65 79 20 3a 3d 20 |ents}...|.key := |
|00003ac0| 43 48 52 28 42 41 6e 64 | 28 65 76 65 6e 74 2e 6d |CHR(BAnd|(event.m|
|00003ad0| 65 73 73 61 67 65 2c 20 | 63 68 61 72 43 6f 64 65 |essage, |charCode|
|00003ae0| 4d 61 73 6b 29 29 3b 0d | 09 09 09 49 46 20 42 41 |Mask));.|...IF BA|
|00003af0| 6e 64 28 65 76 65 6e 74 | 2e 6d 6f 64 69 66 69 65 |nd(event|.modifie|
|00003b00| 72 73 2c 20 63 6d 64 4b | 65 79 29 20 3c 3e 20 30 |rs, cmdK|ey) <> 0|
|00003b10| 20 54 48 45 4e 09 7b 43 | 6f 6d 6d 61 6e 64 20 6b | THEN.{C|ommand k|
|00003b20| 65 79 20 64 6f 77 6e 7d | 0d 09 09 09 09 49 46 20 |ey down}|.....IF |
|00003b30| 65 76 65 6e 74 2e 77 68 | 61 74 20 3d 20 6b 65 79 |event.wh|at = key|
|00003b40| 44 6f 77 6e 20 54 48 45 | 4e 20 42 45 47 49 4e 0d |Down THE|N BEGIN.|
|00003b50| 09 09 09 09 09 41 64 6a | 75 73 74 4d 65 6e 75 73 |.....Adj|ustMenus|
|00003b60| 3b 09 09 09 7b 65 6e 61 | 62 6c 65 2f 64 69 73 61 |;...{ena|ble/disa|
|00003b70| 62 6c 65 2f 63 68 65 63 | 6b 20 6d 65 6e 75 20 69 |ble/chec|k menu i|
|00003b80| 74 65 6d 73 20 70 72 6f | 70 65 72 6c 79 7d 0d 09 |tems pro|perly}..|
|00003b90| 09 09 09 09 44 6f 4d 65 | 6e 75 43 6f 6d 6d 61 6e |....DoMe|nuComman|
|00003ba0| 64 28 4d 65 6e 75 4b 65 | 79 28 6b 65 79 29 29 3b |d(MenuKe|y(key));|
|00003bb0| 0d 09 09 09 09 45 4e 44 | 3b 0d 09 09 45 4e 44 3b |.....END|;...END;|
|00003bc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003bd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003be0| 7b 63 61 6c 6c 20 44 6f | 41 63 74 69 76 61 74 65 |{call Do|Activate|
|00003bf0| 20 77 69 74 68 20 74 68 | 65 20 77 69 6e 64 6f 77 | with th|e window|
|00003c00| 20 61 6e 64 2e 2e 2e 7d | 0d 09 09 61 63 74 69 76 | and...}|...activ|
|00003c10| 61 74 65 45 76 74 3a 20 | 20 20 20 20 20 20 20 20 |ateEvt: | |
|00003c20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 7b | | {|
|00003c30| 54 52 55 45 20 66 6f 72 | 20 61 63 74 69 76 61 74 |TRUE for| activat|
|00003c40| 65 2c 20 46 41 4c 53 45 | 20 66 6f 72 20 64 65 61 |e, FALSE| for dea|
|00003c50| 63 74 69 76 61 74 65 7d | 0d 09 09 09 44 6f 41 63 |ctivate}|....DoAc|
|00003c60| 74 69 76 61 74 65 28 57 | 69 6e 64 6f 77 50 74 72 |tivate(W|indowPtr|
|00003c70| 28 65 76 65 6e 74 2e 6d | 65 73 73 61 67 65 29 2c |(event.m|essage),|
|00003c80| 20 42 41 6e 64 28 65 76 | 65 6e 74 2e 6d 6f 64 69 | BAnd(ev|ent.modi|
|00003c90| 66 69 65 72 73 2c 20 61 | 63 74 69 76 65 46 6c 61 |fiers, a|ctiveFla|
|00003ca0| 67 29 20 3c 3e 20 30 29 | 3b 0d 09 09 75 70 64 61 |g) <> 0)|;...upda|
|00003cb0| 74 65 45 76 74 3a 20 20 | 20 20 20 20 20 20 20 20 |teEvt: | |
|00003cc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003cd0| 7b 63 61 6c 6c 20 44 6f | 55 70 64 61 74 65 20 77 |{call Do|Update w|
|00003ce0| 69 74 68 20 74 68 65 20 | 77 69 6e 64 6f 77 20 74 |ith the |window t|
|00003cf0| 6f 20 75 70 64 61 74 65 | 7d 0d 09 09 09 44 6f 55 |o update|}....DoU|
|00003d00| 70 64 61 74 65 28 57 69 | 6e 64 6f 77 50 74 72 28 |pdate(Wi|ndowPtr(|
|00003d10| 65 76 65 6e 74 2e 6d 65 | 73 73 61 67 65 29 29 3b |event.me|ssage));|
|00003d20| 0d 09 09 7b 31 2e 30 31 | 20 2d 20 49 74 20 69 73 |...{1.01| - It is|
|00003d30| 20 6e 6f 74 20 61 20 62 | 61 64 20 69 64 65 61 20 | not a b|ad idea |
|00003d40| 74 6f 20 61 74 20 6c 65 | 61 73 74 20 63 61 6c 6c |to at le|ast call|
|00003d50| 20 44 49 42 61 64 4d 6f | 75 6e 74 20 69 6e 20 72 | DIBadMo|unt in r|
|00003d60| 65 73 70 6f 6e 73 65 0d | 09 09 20 74 6f 20 61 20 |esponse.|.. to a |
|00003d70| 64 69 73 6b 45 76 74 2c | 20 73 6f 20 74 68 61 74 |diskEvt,| so that|
|00003d80| 20 74 68 65 20 75 73 65 | 72 20 63 61 6e 20 66 6f | the use|r can fo|
|00003d90| 72 6d 61 74 20 61 20 66 | 6c 6f 70 70 79 2e 7d 0d |rmat a f|loppy.}.|
|00003da0| 09 09 64 69 73 6b 45 76 | 74 3a 0d 09 09 09 49 46 |..diskEv|t:....IF|
|00003db0| 20 48 69 57 72 64 28 65 | 76 65 6e 74 2e 6d 65 73 | HiWrd(e|vent.mes|
|00003dc0| 73 61 67 65 29 20 3c 3e | 20 6e 6f 45 72 72 20 54 |sage) <>| noErr T|
|00003dd0| 48 45 4e 20 42 45 47 49 | 4e 0d 09 09 09 09 53 65 |HEN BEGI|N.....Se|
|00003de0| 74 50 74 28 61 50 6f 69 | 6e 74 2c 20 6b 44 49 4c |tPt(aPoi|nt, kDIL|
|00003df0| 65 66 74 2c 20 6b 44 49 | 54 6f 70 29 3b 0d 09 09 |eft, kDI|Top);...|
|00003e00| 09 09 65 72 72 20 3a 3d | 20 44 49 42 61 64 4d 6f |..err :=| DIBadMo|
|00003e10| 75 6e 74 28 61 50 6f 69 | 6e 74 2c 20 65 76 65 6e |unt(aPoi|nt, even|
|00003e20| 74 2e 6d 65 73 73 61 67 | 65 29 3b 0d 09 09 09 45 |t.messag|e);....E|
|00003e30| 4e 44 3b 0d 09 09 6b 4f | 53 45 76 65 6e 74 3a 0d |ND;...kO|SEvent:.|
|00003e40| 09 09 09 43 41 53 45 20 | 42 41 6e 64 28 42 52 6f |...CASE |BAnd(BRo|
|00003e50| 74 4c 28 65 76 65 6e 74 | 2e 6d 65 73 73 61 67 65 |tL(event|.message|
|00003e60| 2c 20 38 29 2c 20 24 46 | 46 29 20 4f 46 09 7b 68 |, 8), $F|F) OF.{h|
|00003e70| 69 67 68 20 62 79 74 65 | 20 6f 66 20 6d 65 73 73 |igh byte| of mess|
|00003e80| 61 67 65 7d 0d 09 09 09 | 09 6b 53 75 73 70 65 6e |age}....|.kSuspen|
|00003e90| 64 52 65 73 75 6d 65 4d | 65 73 73 61 67 65 3a 20 |dResumeM|essage: |
|00003ea0| 42 45 47 49 4e 0d 09 09 | 09 09 09 67 49 6e 42 61 |BEGIN...|...gInBa|
|00003eb0| 63 6b 67 72 6f 75 6e 64 | 20 3a 3d 20 42 41 6e 64 |ckground| := BAnd|
|00003ec0| 28 65 76 65 6e 74 2e 6d | 65 73 73 61 67 65 2c 20 |(event.m|essage, |
|00003ed0| 6b 52 65 73 75 6d 65 4d | 61 73 6b 29 20 3d 20 30 |kResumeM|ask) = 0|
|00003ee0| 3b 0d 09 09 09 09 09 44 | 6f 41 63 74 69 76 61 74 |;......D|oActivat|
|00003ef0| 65 28 46 72 6f 6e 74 57 | 69 6e 64 6f 77 2c 20 4e |e(FrontW|indow, N|
|00003f00| 4f 54 20 67 49 6e 42 61 | 63 6b 67 72 6f 75 6e 64 |OT gInBa|ckground|
|00003f10| 29 3b 0d 09 09 09 09 45 | 4e 44 3b 0d 09 09 09 45 |);.....E|ND;....E|
|00003f20| 4e 44 3b 0d 09 45 4e 44 | 3b 0d 45 4e 44 3b 20 7b |ND;..END|;.END; {|
|00003f30| 44 6f 45 76 65 6e 74 7d | 0d 0d 0d 7b 24 53 20 4d |DoEvent}|...{$S M|
|00003f40| 61 69 6e 7d 0d 50 52 4f | 43 45 44 55 52 45 20 45 |ain}.PRO|CEDURE E|
|00003f50| 76 65 6e 74 4c 6f 6f 70 | 3b 0d 0d 56 41 52 0d 09 |ventLoop|;..VAR..|
|00003f60| 63 75 72 73 6f 72 52 67 | 6e 09 3a 20 52 67 6e 48 |cursorRg|n.: RgnH|
|00003f70| 61 6e 64 6c 65 3b 0d 09 | 67 6f 74 45 76 65 6e 74 |andle;..|gotEvent|
|00003f80| 09 3a 20 42 4f 4f 4c 45 | 41 4e 3b 0d 09 65 76 65 |.: BOOLE|AN;..eve|
|00003f90| 6e 74 09 09 3a 20 45 76 | 65 6e 74 52 65 63 6f 72 |nt..: Ev|entRecor|
|00003fa0| 64 3b 0d 09 6d 6f 75 73 | 65 09 09 3a 20 50 6f 69 |d;..mous|e..: Poi|
|00003fb0| 6e 74 3b 0d 0d 42 45 47 | 49 4e 0d 09 63 75 72 73 |nt;..BEG|IN..curs|
|00003fc0| 6f 72 52 67 6e 20 3a 3d | 20 4e 65 77 52 67 6e 3b |orRgn :=| NewRgn;|
|00003fd0| 09 09 09 09 7b 77 65 d5 | 6c 6c 20 70 61 73 73 20 |....{we.|ll pass |
|00003fe0| 57 4e 45 20 61 6e 20 65 | 6d 70 74 79 20 72 65 67 |WNE an e|mpty reg|
|00003ff0| 69 6f 6e 20 74 68 65 20 | 31 73 74 20 74 69 6d 65 |ion the |1st time|
|00004000| 20 74 68 72 75 7d 0d 09 | 52 45 50 45 41 54 0d 09 | thru}..|REPEAT..|
|00004010| 09 49 46 20 67 48 61 73 | 57 61 69 74 4e 65 78 74 |.IF gHas|WaitNext|
|00004020| 45 76 65 6e 74 20 54 48 | 45 4e 20 42 45 47 49 4e |Event TH|EN BEGIN|
|00004030| 09 7b 70 75 74 20 75 73 | 20 27 61 73 6c 65 65 70 |.{put us| 'asleep|
|00004040| 27 20 66 6f 72 65 76 65 | 72 20 75 6e 64 65 72 20 |' foreve|r under |
|00004050| 4d 75 6c 74 69 46 69 6e | 64 65 72 7d 0d 09 09 09 |MultiFin|der}....|
|00004060| 47 65 74 47 6c 6f 62 61 | 6c 4d 6f 75 73 65 28 6d |GetGloba|lMouse(m|
|00004070| 6f 75 73 65 29 3b 09 09 | 7b 73 69 6e 63 65 20 77 |ouse);..|{since w|
|00004080| 65 20 6d 69 67 68 74 20 | 67 6f 20 74 6f 20 73 6c |e might |go to sl|
|00004090| 65 65 70 7d 0d 09 09 09 | 41 64 6a 75 73 74 43 75 |eep}....|AdjustCu|
|000040a0| 72 73 6f 72 28 6d 6f 75 | 73 65 2c 20 63 75 72 73 |rsor(mou|se, curs|
|000040b0| 6f 72 52 67 6e 29 3b 0d | 09 09 09 67 6f 74 45 76 |orRgn);.|...gotEv|
|000040c0| 65 6e 74 20 3a 3d 20 57 | 61 69 74 4e 65 78 74 45 |ent := W|aitNextE|
|000040d0| 76 65 6e 74 28 65 76 65 | 72 79 45 76 65 6e 74 2c |vent(eve|ryEvent,|
|000040e0| 20 65 76 65 6e 74 2c 20 | 4d 41 58 4c 4f 4e 47 49 | event, |MAXLONGI|
|000040f0| 4e 54 2c 20 63 75 72 73 | 6f 72 52 67 6e 29 3b 0d |NT, curs|orRgn);.|
|00004100| 09 09 45 4e 44 20 45 4c | 53 45 20 42 45 47 49 4e |..END EL|SE BEGIN|
|00004110| 0d 09 09 09 53 79 73 74 | 65 6d 54 61 73 6b 3b 09 |....Syst|emTask;.|
|00004120| 09 09 09 09 7b 6d 75 73 | 74 20 62 65 20 63 61 6c |....{mus|t be cal|
|00004130| 6c 65 64 20 69 66 20 75 | 73 69 6e 67 20 47 65 74 |led if u|sing Get|
|00004140| 4e 65 78 74 45 76 65 6e | 74 7d 0d 09 09 09 67 6f |NextEven|t}....go|
|00004150| 74 45 76 65 6e 74 20 3a | 3d 20 47 65 74 4e 65 78 |tEvent :|= GetNex|
|00004160| 74 45 76 65 6e 74 28 65 | 76 65 72 79 45 76 65 6e |tEvent(e|veryEven|
|00004170| 74 2c 20 65 76 65 6e 74 | 29 3b 0d 09 09 45 4e 44 |t, event|);...END|
|00004180| 3b 0d 09 09 49 46 20 67 | 6f 74 45 76 65 6e 74 20 |;...IF g|otEvent |
|00004190| 54 48 45 4e 20 42 45 47 | 49 4e 0d 09 09 09 41 64 |THEN BEG|IN....Ad|
|000041a0| 6a 75 73 74 43 75 72 73 | 6f 72 28 65 76 65 6e 74 |justCurs|or(event|
|000041b0| 2e 77 68 65 72 65 2c 20 | 63 75 72 73 6f 72 52 67 |.where, |cursorRg|
|000041c0| 6e 29 3b 09 7b 6d 61 6b | 65 20 73 75 72 65 20 77 |n);.{mak|e sure w|
|000041d0| 65 20 68 61 76 65 20 74 | 68 65 20 72 69 67 68 74 |e have t|he right|
|000041e0| 20 63 75 72 73 6f 72 7d | 0d 09 09 09 44 6f 45 76 | cursor}|....DoEv|
|000041f0| 65 6e 74 28 65 76 65 6e | 74 29 3b 0d 09 09 45 4e |ent(even|t);...EN|
|00004200| 44 3b 0d 09 09 7b 49 66 | 20 79 6f 75 20 61 72 65 |D;...{If| you are|
|00004210| 20 75 73 69 6e 67 20 6d | 6f 64 65 6c 65 73 73 20 | using m|odeless |
|00004220| 64 69 61 6c 6f 67 73 20 | 74 68 61 74 20 68 61 76 |dialogs |that hav|
|00004230| 65 20 65 64 69 74 54 65 | 78 74 20 69 74 65 6d 73 |e editTe|xt items|
|00004240| 2c 0d 09 09 20 79 6f 75 | 20 77 69 6c 6c 20 77 61 |,... you| will wa|
|00004250| 6e 74 20 74 6f 20 63 61 | 6c 6c 20 49 73 44 69 61 |nt to ca|ll IsDia|
|00004260| 6c 6f 67 45 76 65 6e 74 | 20 74 6f 20 67 69 76 65 |logEvent| to give|
|00004270| 20 74 68 65 20 63 61 72 | 65 74 20 61 20 63 68 61 | the car|et a cha|
|00004280| 6e 63 65 0d 09 09 20 74 | 6f 20 62 6c 69 6e 6b 2c |nce... t|o blink,|
|00004290| 20 65 76 65 6e 20 69 66 | 20 57 4e 45 2f 47 4e 45 | even if| WNE/GNE|
|000042a0| 20 72 65 74 75 72 6e 65 | 64 20 46 41 4c 53 45 2e | returne|d FALSE.|
|000042b0| 20 48 6f 77 65 76 65 72 | 2c 20 63 68 65 63 6b 20 | However|, check |
|000042c0| 46 72 6f 6e 74 57 69 6e | 64 6f 77 0d 09 09 20 66 |FrontWin|dow... f|
|000042d0| 6f 72 20 61 20 6e 6f 6e | 2d 4e 49 4c 20 76 61 6c |or a non|-NIL val|
|000042e0| 75 65 20 62 65 66 6f 72 | 65 20 63 61 6c 6c 69 6e |ue befor|e callin|
|000042f0| 67 20 49 73 44 69 61 6c | 6f 67 45 76 65 6e 74 2e |g IsDial|ogEvent.|
|00004300| 7d 0d 09 55 4e 54 49 4c | 20 46 41 4c 53 45 3b 09 |}..UNTIL| FALSE;.|
|00004310| 09 09 09 09 09 7b 6c 6f | 6f 70 20 66 6f 72 65 76 |.....{lo|op forev|
|00004320| 65 72 3b 20 77 65 20 71 | 75 69 74 20 74 68 72 6f |er; we q|uit thro|
|00004330| 75 67 68 20 61 6e 20 45 | 78 69 74 54 6f 53 68 65 |ugh an E|xitToShe|
|00004340| 6c 6c 7d 0d 45 4e 44 3b | 20 7b 45 76 65 6e 74 4c |ll}.END;| {EventL|
|00004350| 6f 6f 70 7d 0d 0d 0d 50 | 52 4f 43 45 44 55 52 45 |oop}...P|ROCEDURE|
|00004360| 20 5f 44 61 74 61 49 6e | 69 74 3b 20 45 58 54 45 | _DataIn|it; EXTE|
|00004370| 52 4e 41 4c 3b 0d 0d 7b | 24 53 20 4d 61 69 6e 7d |RNAL;..{|$S Main}|
|00004380| 0d 42 45 47 49 4e 0d 09 | 55 6e 6c 6f 61 64 53 65 |.BEGIN..|UnloadSe|
|00004390| 67 28 40 5f 44 61 74 61 | 49 6e 69 74 29 3b 09 7b |g(@_Data|Init);.{|
|000043a0| 6e 6f 74 65 20 74 68 61 | 74 20 5f 44 61 74 61 49 |note tha|t _DataI|
|000043b0| 6e 69 74 20 6d 75 73 74 | 20 6e 6f 74 20 62 65 20 |nit must| not be |
|000043c0| 69 6e 20 4d 61 69 6e 21 | 7d 0d 09 0d 09 7b 31 2e |in Main!|}....{1.|
|000043d0| 30 31 20 2d 20 63 61 6c | 6c 20 74 6f 20 46 6f 72 |01 - cal|l to For|
|000043e0| 63 65 45 6e 76 69 72 6f | 6e 73 20 72 65 6d 6f 76 |ceEnviro|ns remov|
|000043f0| 65 64 7d 0d 09 7b 49 66 | 20 79 6f 75 20 68 61 76 |ed}..{If| you hav|
|00004400| 65 20 73 74 61 63 6b 20 | 72 65 71 75 69 72 65 6d |e stack |requirem|
|00004410| 65 6e 74 73 20 74 68 61 | 74 20 64 69 66 66 65 72 |ents tha|t differ|
|00004420| 20 66 72 6f 6d 20 74 68 | 65 20 64 65 66 61 75 6c | from th|e defaul|
|00004430| 74 2c 0d 09 20 74 68 65 | 6e 20 79 6f 75 20 63 6f |t,.. the|n you co|
|00004440| 75 6c 64 20 75 73 65 20 | 53 65 74 41 70 70 6c 4c |uld use |SetApplL|
|00004450| 69 6d 69 74 20 74 6f 20 | 69 6e 63 72 65 61 73 65 |imit to |increase|
|00004460| 20 53 74 61 63 6b 53 70 | 61 63 65 20 61 74 20 0d | StackSp|ace at .|
|00004470| 09 20 74 68 69 73 20 70 | 6f 69 6e 74 2c 20 62 65 |. this p|oint, be|
|00004480| 66 6f 72 65 20 63 61 6c | 6c 69 6e 67 20 4d 61 78 |fore cal|ling Max|
|00004490| 41 70 70 6c 5a 6f 6e 65 | 2e 7d 0d 09 20 0d 09 4d |ApplZone|.}.. ..M|
|000044a0| 61 78 41 70 70 6c 5a 6f | 6e 65 3b 09 09 09 7b 65 |axApplZo|ne;...{e|
|000044b0| 78 70 61 6e 64 20 74 68 | 65 20 68 65 61 70 20 73 |xpand th|e heap s|
|000044c0| 6f 20 63 6f 64 65 20 73 | 65 67 6d 65 6e 74 73 20 |o code s|egments |
|000044d0| 6c 6f 61 64 20 61 74 20 | 74 68 65 20 74 6f 70 7d |load at |the top}|
|000044e0| 0d 0d 09 49 6e 69 74 69 | 61 6c 69 7a 65 3b 09 09 |...Initi|alize;..|
|000044f0| 09 09 7b 69 6e 69 74 69 | 61 6c 69 7a 65 20 74 68 |..{initi|alize th|
|00004500| 65 20 70 72 6f 67 72 61 | 6d 7d 0d 09 55 6e 6c 6f |e progra|m}..Unlo|
|00004510| 61 64 53 65 67 28 40 49 | 6e 69 74 69 61 6c 69 7a |adSeg(@I|nitializ|
|00004520| 65 29 3b 09 7b 6e 6f 74 | 65 20 74 68 61 74 20 49 |e);.{not|e that I|
|00004530| 6e 69 74 69 61 6c 69 7a | 65 20 6d 75 73 74 20 6e |nitializ|e must n|
|00004540| 6f 74 20 62 65 20 69 6e | 20 4d 61 69 6e 21 7d 0d |ot be in| Main!}.|
|00004550| 0d 09 45 76 65 6e 74 4c | 6f 6f 70 3b 09 09 09 09 |..EventL|oop;....|
|00004560| 7b 63 61 6c 6c 20 74 68 | 65 20 6d 61 69 6e 20 65 |{call th|e main e|
|00004570| 76 65 6e 74 20 6c 6f 6f | 70 7d 0d 45 4e 44 2e 0d |vent loo|p}.END..|
|00004580| 00 00 01 00 00 00 01 6d | 00 00 00 6d 00 00 00 46 |.......m|...m...F|
|00004590| 50 6f 72 74 5e 2e 70 6f | 72 74 52 65 63 74 2c 20 |Port^.po|rtRect, |
|000045a0| 74 65 78 74 48 29 3b 20 | 7b 63 61 6c 6c 20 54 65 |textH); |{call Te|
|000045b0| 08 53 61 6d 70 6c 65 2e | 70 6d 02 00 00 00 54 45 |.Sample.|pm....TE|
|000045c0| 58 54 4d 50 53 20 01 00 | 00 3f 00 62 00 00 00 00 |XTMPS ..|.?.b....|
|000045d0| 00 00 54 45 58 54 4d 50 | 53 20 01 00 00 3f 00 62 |..TEXTMP|S ...?.b|
|000045e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045f0| 00 00 a0 c2 90 c0 00 00 | 45 00 00 00 01 b3 69 6e |........|E.....in|
|00004600| 64 6f 77 20 4d 67 72 20 | 74 6f 20 65 6e 64 20 75 |dow Mgr |to end u|
|00004610| 70 64 61 74 65 7d 0d 09 | 09 09 20 20 45 4e 44 3b |pdate}..|.. END;|
|00004620| 20 7b 6f 66 20 75 70 64 | 61 74 65 45 76 74 7d 0d | {of upd|ateEvt}.|
|00004630| 0d 09 09 45 4e 44 3b 20 | 7b 6f 66 20 65 76 65 6e |...END; |{of even|
|00004640| 74 20 43 41 53 45 7d 0d | 0d 09 55 4e 54 49 4c 20 |t CASE}.|..UNTIL |
|00004650| 64 6f 6e 65 46 6c 61 67 | 3b 0d 20 20 45 4e 44 2e |doneFlag|;. END.|
|00004660| 0d 46 49 52 4d 20 4e 56 | 00 00 48 e7 20 00 4e ad |.FIRM NV|..H. .N.|
|00004670| 00 4a 4a 80 67 08 4e ba | e3 28 70 00 60 20 4e ba |.JJ.g.N.|.(p.` N.|
|00004680| 00 00 00 1d 03 01 60 01 | 00 00 05 33 2e 31 42 31 |......`.|...3.1B1|
|00004690| 10 4d 50 57 20 50 61 73 | 63 61 6c 20 33 2e 31 42 |.MPW Pas|cal 3.1B|
|000046a0| 31 00 00 00 48 00 09 4d | 6f 6e 61 63 6f 00 00 00 |1...H..M|onaco...|
|000046b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046c0| 00 00 00 00 00 00 00 00 | 06 00 04 00 38 00 84 03 |........|....8...|
|000046d0| 27 03 66 00 38 00 84 03 | 27 03 66 a1 3d 68 c5 00 |'.f.8...|'.f.=h..|
|000046e0| 00 0a e4 00 00 0a e4 00 | 00 06 4a 01 00 00 00 01 |........|..J.....|
|000046f0| 00 00 00 01 6d 00 00 00 | 6d 00 00 00 46 00 17 dc |....m...|m...F...|
|00004700| 74 04 6a 00 00 00 1c 00 | 46 00 01 76 65 72 73 00 |t.j.....|F..vers.|
|00004710| 00 00 12 4d 50 53 52 00 | 00 00 1e 00 02 ff ff 20 |...MPSR.|....... |
|00004720| 00 00 00 00 00 00 00 03 | ed ff ff 00 00 00 21 00 |........|......!.|
|00004730| 19 72 a0 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.r......|........|
|00004740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+